REGEX for query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Howdy boys and girls!

I have a rather interesting issue. I need to locate every query in every
PHP application we have for an integration project. I have started doing
some research, but I wanted throw this out there as a little exercize
because it is interesting.

Several queries are written as 

$variableName = "SELECT foo FROM bar WHERE glorp = '12' ";

Others are written as

$variableName = "INSERT INTO bar (foo) ";
$variableName .= "VALUES ('".$foo."') ";

And still others may be written as

$variableName = "SELECT foo ";
$variableName .= "FROM bar ";
$variableName .= "WHERE glorp = '12' ";
while('stinky' == $caca){
   $variableName .= "AND poot = '" . $caca['texture'] . "' ";
}

How would you begin to get the queries using PHP? Regex? Other methods?
I am working on isolating where the applications live right now, but I
would be thrilled to read your opinions and methods.

Thanks!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux