FuZion
05-21-2008, 03:15 AM
Hello,
I have this line in a mysql function in my PHP app.
$query = preg_replace('#\{(.*)\}#e', 'tab("\1")', $query);
It is supposed to take everything between { and } and replace with with a table name supplied from the tab() function. Now it works file when I have just one table name, but when I have two table names it functions incorrectly, replacing everything between the first { and the last }.
For example,
FROM {table1} t, {table2} j
would read everything from the t in table1 to the 2 in table2.
Is there a way to fix this?
thanks!
I have this line in a mysql function in my PHP app.
$query = preg_replace('#\{(.*)\}#e', 'tab("\1")', $query);
It is supposed to take everything between { and } and replace with with a table name supplied from the tab() function. Now it works file when I have just one table name, but when I have two table names it functions incorrectly, replacing everything between the first { and the last }.
For example,
FROM {table1} t, {table2} j
would read everything from the t in table1 to the 2 in table2.
Is there a way to fix this?
thanks!