query IS NULL error
Posted: Wed Feb 11, 2009 12:09 pm
Hello,
I have this piece of code:
And when i try to run the script it outputs this:
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 'group IS NULL' at line 1
The 'group' field is a varchar type and is set to NULL by default.
What could be the couse of this error?
Without the "AND group IS NULL" it works fine btw.
I have this piece of code:
Code: Select all
foreach(range("a","z") as $letter){
$result = mysql_query("SELECT * FROM mails WHERE mail LIKE '{$letter}%' AND group IS NULL") or die("ERROR:".mysql_error());
}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 'group IS NULL' at line 1
The 'group' field is a varchar type and is set to NULL by default.
What could be the couse of this error?
Without the "AND group IS NULL" it works fine btw.