Download the PHP package marcocesarato/sqlparser without Composer
On this page you can find all versions of the php package marcocesarato/sqlparser. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download marcocesarato/sqlparser
More information about marcocesarato/sqlparser
Files in marcocesarato/sqlparser
Package sqlparser
Short Description This class can parse SQL to get query type, tables, field values, etc.. It takes an string with a SQL statements and parses it to extract its different components. Currently the class can extract the SQL query method, the names of the tables involved in the query and the field values that are passed as parameters. This parser is pretty light respect phpsqlparser or others php sql parser.
License GPL-3.0-or-later
Informations about the package sqlparser
PHP Light SQL Parser Class
Version: 0.2.105 beta
Github: https://github.com/marcocesarato/PHP-Light-SQL-Parser-Class
Author: Marco Cesarato
Description
This class can parse SQL to get query type, tables, field values, etc..
It takes an string with a SQL statements and parses it to extract its different components.
Currently the class can extract the SQL query method, the names of the tables involved in the query and the field values that are passed as parameters. This parser is pretty light respect phpsqlparser or others php sql parser.
Requirements
- php 4+
Install
Composer
- Install composer
- Type
composer require marcocesarato/sqlparser
- Enjoy
Usage
OR
Method
How to retrieve the query's method:
Output
Tables
How to retrieve the main the query's table:
Output
How to retrieve the query's tables:
Output
Fields
How to retrieve the query's fields:
Output
Methods
LightSQLParser
Method | Parameters | Description |
---|---|---|
__construct | Constructor | |
setQuery | Set SQL Query string | |
getQuery | return array | Get SQL Query string |
getAllQuery | return string | Get SQL All Query string |
getMethod | param $query return string |
Get SQL Query method |
getFields | param $query return array |
Get Query fields (at the moment only SELECTINSERTUPDATE) |
getTable | param $query return string |
Get SQL Query First Table |
getTables | return array | Get SQL Query Tables |
getJoinTables | return array | Get SQL Query Join Tables |
hasJoin | return bool | Return if has join tables |
getSubQueries | return array | Get all SELECT subqueries |
hasSubQueries | return bool | Return if has subqueries |