Welcome Guest, Not a member yet? Register   Sign In
Query Binding Not Replacing '?'
#1

[eluser]hightower[/eluser]
I have the following code:

Code:
$sql = "SELECT articles.body, articles.user_id, users.username FROM articles, users WHERE ? = 1 AND articles.user_id = users.user_id ORDER BY ?";

$query = $this->db->query($sql, array('item1', 'item2'));
echo $sql;

The output from the echo however is:

Code:
SELECT articles.body, articles.user_id, users.username FROM articles, users WHERE ? = 1 AND articles.user_id = users.user_id ORDER BY ?

It's not replacing the question marks. I've checked the code, and it looks ok, and I've searched the forums/userguide but can't find anything that might help.

Anybody got any ideas?


Messages In This Thread
Query Binding Not Replacing '?' - by El Forum - 08-21-2009, 01:53 AM
Query Binding Not Replacing '?' - by El Forum - 08-21-2009, 01:56 AM
Query Binding Not Replacing '?' - by El Forum - 08-21-2009, 01:59 AM
Query Binding Not Replacing '?' - by El Forum - 08-21-2009, 02:00 AM



Theme © iAndrew 2016 - Forum software by © MyBB