SQL syntax when using Active Record Class |
[eluser]Linh Pham[/eluser]
Hi there, i am using these code lines. Quote:$array = array('name !=' => $name, 'id <' => $id, 'date >' => $date);But i dont know why it says 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 '`!= ` 'my name' Please help me this problem
[eluser]CI_expert_indian[/eluser]
Try this dear ..... $this->db->where('name !=', $name); $this->db->where('id <', $id);
[eluser]insert_hilarity_here[/eluser]
operators in where expressions do not work in CI 2.1.1 so you cannot write $this->db->where(‘name !=’, $name); $this->db->where(‘id <’, $id); because it will quote the operators != and < https://github.com/EllisLab/CodeIgniter/issues/1469 if you are on 2.1.1 you should downgrade to 2.1.0 |
Welcome Guest, Not a member yet? Register Sign In |