Warning: chmod(): Operation not permitted in /var/www/hopeinstoughton_www/wp-content/plugins/simple-universal-google-analytics/main.php on line 8 [0] in function chmod in /var/www/hopeinstoughton_www/wp-content/plugins/simple-universal-google-analytics/main.php on line 8 [1] in function include_once in /var/www/hopeinstoughton_www/wp-settings.php on line 560 [2] in function require_once in /var/www/hopeinstoughton_www/wp-config.php on line 85 [3] in function require_once in /var/www/hopeinstoughton_www/wp-load.php on line 50 [4] in function require_once in /var/www/hopeinstoughton_www/wp-blog-header.php on line 13 [5] in function require in /var/www/hopeinstoughton_www/index.php on line 17
| Server IP : 94.177.8.99 / Your IP : 216.73.217.165 Web Server : Apache/2.4.58 (Ubuntu) System : Linux aries 6.8.0-134-generic #134-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 26 18:43:11 UTC 2026 x86_64 User : www-data ( 33) PHP Version : 8.1.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/patientapps_support/modules/sqlparser/ |
Upload File : |
PHP-SQL-Parser
==============
A pure PHP SQL (non validating) parser w/ focus on MySQL dialect of SQL
### Download
[GitHub Wiki](https://github.com/greenlion/PHP-SQL-Parser/wiki/Downloads)<br>
### Full support for the MySQL dialect for the following statement types
SELECT
INSERT
UPDATE
DELETE
REPLACE
RENAME
SHOW
SET
DROP
CREATE INDEX
CREATE TABLE
EXPLAIN
DESCRIBE
### Other SQL statement types
Other statements are returned as an array of tokens. This is not as structured as the information available about the above types. See the [ParserManual](https://github.com/greenlion/PHP-SQL-Parser/wiki/Parser-Manual) for more information.
### Other SQL dialects
Since the MySQL SQL dialect is very close to SQL-92, this should work for most database applications that need a SQL parser. If using another database dialect, then you may want to change the reserved words - see the [ParserManual](https://github.com/greenlion/PHP-SQL-Parser/wiki/Parser-Manual). It supports UNION, subqueries and compound statements.
### External dependencies
The parser is a self contained class. It has no external dependencies. The parser uses a small amount of regex.
### Focus
The focus of the parser is complete and accurate support for the MySQL SQL dialect. The focus is not on optimizing for performance. It is expected that you will present syntactically valid queries.
### Manual
[ParserManual](https://github.com/greenlion/PHP-SQL-Parser/wiki/Parser-Manual) - Check out the manual.
### Example Output
**Example Query**
```sql
SELECT STRAIGHT_JOIN a, b, c
FROM some_table an_alias
WHERE d > 5;
```
**Example Output (via print_r)**
```php
Array
(
[OPTIONS] => Array
(
[0] => STRAIGHT_JOIN
)
[SELECT] => Array
(
[0] => Array
(
[expr_type] => colref
[base_expr] => a
[sub_tree] =>
[alias] => `a`
)
[1] => Array
(
[expr_type] => colref
[base_expr] => b
[sub_tree] =>
[alias] => `b`
)
[2] => Array
(
[expr_type] => colref
[base_expr] => c
[sub_tree] =>
[alias] => `c`
)
)
[FROM] => Array
(
[0] => Array
(
[table] => some_table
[alias] => an_alias
[join_type] => JOIN
[ref_type] =>
[ref_clause] =>
[base_expr] =>
[sub_tree] =>
)
)
[WHERE] => Array
(
[0] => Array
(
[expr_type] => colref
[base_expr] => d
[sub_tree] =>
)
[1] => Array
(
[expr_type] => operator
[base_expr] => >
[sub_tree] =>
)
[2] => Array
(
[expr_type] => const
[base_expr] => 5
[sub_tree] =>
)
)
)
```