Surely an easy problem, but I can’t get is solved…
I just want to detect if my sql query is starting with a “select” or anything else.
This code seems not to work :
if (preg_match("/^(select)/i", $sql) > 0)
{
// SELECT query
}
else
{
// other query
}
Thanks for your help !
[EDIT]
Ok, I have the root cause:
I may have spaces, tabs and line returns before the keyword “select”…
OK, I got it :
Thanks for your answers anyway !