REGEX for query
| From: | Jay Blanchard | Date: | Wed, 10 Aug 2005 15:45:52 +0000 |
| Subject: | REGEX for query | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-220344@lists.php.net to get a copy of this message | ||
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!