I read following sql-statement from my db-table:
select a,b,c from MyTable where d=$e
$e is set before to 2
I want to make a query like this:
select a,b,c from MyTable where d=2
but the variable $e is not resolved
I get following statement in my sql parser:
select a,b,c from MyTable where d=$e
that's not a proper sql-syntax.
I don't know how to solve this problem.
manualy replacing with str_replace make no sense, because the sql-sattements are complex and have many different variables
Roel wrote:
I'm sorry, I still don't understand the question. You read an sql statement from a table, and now you want to replace variables in this sql statement with other values? You'd have to look at str_replace or ereg_replace for that. However, this doesn't seem good practice to me.