Not sure if I am in the right place, so forgive me if I'm not.
I am using an adodb abstraction layer to communicate with a mysql db. The problem is that why I run the query() function, adobd is putting quotes into it, which is causing an error.
I have a function that loops through an array, and generates a query from it:
PHP Code:$query = "SELECT ? FROM ? WHERE var = ?";
$res = $this->query($query,
array($arr['var_name'],$arr['table_name'],$cond)
);
Obviously, the problem is that the quotes are not appropriate when referring to a table in mysql (should use ` or nothing).Code:this results in: mysql error: 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 ''table' WHERE var=''1'' A in query: SELECT ? FROM ? WHERE var='?'
so the simple question is how do i trick adodb so that it does not wrap the varaible in quotes before passing to the db, so that the WHERE statement does not mess up?
Any help would be much appreciated.




Bookmarks