Welcome Guest, Not a member yet? Register   Sign In
Database class where() throwing error
#1

[eluser]jrlooney[/eluser]
I just upgraded from 1.6.3 to 1.7.1 and I am getting a DB error now when using the where() function.

I have a function which builds up the WHERE clause in a string and then I call:

Code:
$this->db->where($where);

The error it now throws:

Code:
A Database Error Occurred
Error Number: 1054
Unknown column ' last_name LIKE '%Doe%' LIMIT 20' in 'where clause'
SELECT * FROM (`cm_contact`) WHERE ` last_name LIKE '%Doe%' LIMIT 20

Notice the backtick character right after the word WHERE

So I echoed the $where variable right before calling where():

Code:
echo $where;
$this->db->where($where);

And it output:

Code:
last_name LIKE '%Doe%'

So that backtick must be coming from the database class. I tried to look around in the system files but could not find anything helpful. Any ideas where to look (like where is the WHERE clause actually put together)?

thank you in advance




Theme © iAndrew 2016 - Forum software by © MyBB