I have used eval function before this. But I am not sure why this one is not working for me.
I do have one function which returns me some filter string. It returns string something like this.
AND TM_ID=$row_tMain[TM_ID] AND TM_DATE=$row_tMain[TM_DATE]
I want to use this string in my query something like this.
$sql="SELECT * FROM TABLE WHERE TM_ID > 2000 ".$filterString;
Here $filterString is my string returned from the function as above example.
But when I run the page it gives error that
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[TM_ID] AND TM_DATE=$row_testMain[TM_DATE]'
My row variable's name is fix as row_tMain but i m unable to evaluate it as value in my query string any idea ?? :(
How can I achieve this without the eval or with eval.
Thanks In Advance