Welcome Guest, Not a member yet? Register   Sign In
active record where field IS NULL error?
#1

[eluser]KrizzAngel[/eluser]
with this code:
Quote:$this->db->where('name',$this->input->post('name'));
$this->db->where('section',NULL);
$ilan = $this->db->count_all_results();
i got this error when running it:
Quote:A Database Error Occurred

Error Number: 1064

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 'WHERE `name` = 'teddy' AND `section` IS NULL' at line 2

SELECT COUNT(*) AS `numrows` WHERE `name` = 'teddy' AND `section` IS NULL

any problem from my code?? is NULL not allowed on 'where' clause in AR??


Messages In This Thread
active record where field IS NULL error? - by El Forum - 02-28-2010, 03:13 AM
active record where field IS NULL error? - by El Forum - 02-28-2010, 06:47 AM
active record where field IS NULL error? - by El Forum - 02-28-2010, 08:51 AM
active record where field IS NULL error? - by El Forum - 02-28-2010, 09:48 AM
active record where field IS NULL error? - by El Forum - 02-28-2010, 06:56 PM



Theme © iAndrew 2016 - Forum software by © MyBB