PHP Classes

what is it's efficiency

Recommend this page to a friend!

      Quick PHP MySQL Parser  >  All threads  >  what is it's efficiency  >  (Un) Subscribe thread alerts  
Subject:what is it's efficiency
Summary:what is this package's work? and plz explain more
Messages:2
Author:behnamy
Date:2015-04-09 16:18:38
 

  1. what is it's efficiency   Reply   Report abuse  
Picture of behnamy behnamy - 2015-04-09 16:18:38
Hi. would you explain more that what does this package do, and where we can use it?

age mishe ham bizahmat be farsi ham vasam benevis dadash, chon man ma'ni kalame token ro nemidonam, nafahmidam kol package vase chie aslan.

  2. Re: what is it's efficiency   Reply   Report abuse  
Picture of Abius X Abius X - 2015-04-09 16:35:58 - In reply to message 1 from behnamy
This package can be used to break down a SQL statement to its building blocks, i.e tokens. For example:


SELECT * FROM users WHERE /* some comment */ username='admin' AND password=1234

Would become:

Array
(
[0] => Array
(
[original] => SELECT
[type] => keyword
[position] => 0
[length] => 6
[clean] => SELECT
)

[1] => Array
(
[original] => *
[type] => identifier
[position] => 7
[length] => 1
[clean] => *
)

[2] => Array
(
[original] => FROM
[type] => keyword
[position] => 9
[length] => 4
[clean] => FROM
)

[3] => Array
(
[original] => users
[type] => identifier
[position] => 14
[length] => 5
[clean] => users
)

[4] => Array
(
[original] => WHERE
[type] => keyword
[position] => 20
[length] => 5
[clean] => WHERE
)

[5] => Array
(
[original] => /* some comment */
[type] => multiline-comment
[position] => 26
[length] => 18
[clean] => /* some comment */
)

[6] => Array
(
[original] => username
[type] => identifier
[position] => 45
[length] => 8
[clean] => username
)

[7] => Array
(
[original] => =
[type] => symbol
[position] => 53
[length] => 1
[clean] => =
)

[8] => Array
(
[original] => 'admin'
[type] => string
[position] => 54
[length] => 7
[clean] => 'admin'
)

[9] => Array
(
[original] => AND
[type] => keyword
[position] => 62
[length] => 3
[clean] => AND
)

[10] => Array
(
[original] => password
[type] => function
[position] => 66
[length] => 8
[clean] => PASSWORD
)

[11] => Array
(
[original] => =
[type] => symbol
[position] => 74
[length] => 1
[clean] => =
)

[12] => Array
(
[original] => 1234
[type] => number
[position] => 75
[length] => 4
[clean] => 1234
)

)

This information can be used to check security of the SQL query, as well as making it nicer, uniformer, and understanding its structure so that you can perform caching.