LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Simple SQL question (https://www.linuxquestions.org/questions/programming-9/simple-sql-question-490065/)

joelhop 10-06-2006 01:11 PM

Simple SQL question
 
I am using Php and MySQL. I'm trying to do a query that searches for entires that have a NULL value in the used field.

$query = "SELECT * FROM codes WHERE used = NULL";


Several entries do have a null value, however I am not returning anything with my query. Is there a specific syntax for search for = NULL or != NULL fields?

Would it just be is NULL and not NULL? something like that?

Thanks,
Karl

nadroj 10-06-2006 01:39 PM

try 'is' instead of '='


All times are GMT -5. The time now is 06:27 PM.