realjumper Posted November 7, 2006 Share Posted November 7, 2006 Hi,If I have a field in my DB with a default value of NULL, is it possible to search by this value?.......[code]// Retrieve all the data from the table$result = mysql_query("SELECT username,passwd,country FROM my_table WHERE country = 'NULL'") or die(mysql_error()); [/code] Link to comment https://forums.phpfreaks.com/topic/26505-search-for-null-solved/ Share on other sites More sharing options...
Barand Posted November 7, 2006 Share Posted November 7, 2006 .... WHERE country IS NULL Link to comment https://forums.phpfreaks.com/topic/26505-search-for-null-solved/#findComment-121243 Share on other sites More sharing options...
realjumper Posted November 7, 2006 Author Share Posted November 7, 2006 Perfect!! I just tested this exact thing and as you say 'IS' is the correct syntax.Many thanks Link to comment https://forums.phpfreaks.com/topic/26505-search-for-null-solved/#findComment-121258 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.