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.