njdubois Posted October 26, 2012 Share Posted October 26, 2012 Using phpMyadmin, the mysql tool godaddy provides: I have a table named users with these fields: id, name, password, contact_id there is a bunch of rows where the contact_id=NULL I only want to view those: SELECT * FROM users WHERE contact_id=NULL but it returns 0 results? SELECT * FROM users WHERE contact_id="NULL" SELECT * FROM users WHERE contact_id="" return the same, nothing. What can I post to better help you diagnose my problem? Thanks for your time! Nick Link to comment https://forums.phpfreaks.com/topic/269937-mysql-command-not-working-the-way-i-had-hoped/ Share on other sites More sharing options...
Christian F. Posted October 26, 2012 Share Posted October 26, 2012 "field IS NULL" is the proper syntax when checking for NULL in MySQL. Link to comment https://forums.phpfreaks.com/topic/269937-mysql-command-not-working-the-way-i-had-hoped/#findComment-1387929 Share on other sites More sharing options...
Jessica Posted October 26, 2012 Share Posted October 26, 2012 "NULL" is a string. Try contact_id IS NULL If that doesn't work, post your table structure, and some screenshots of the actual rows. Link to comment https://forums.phpfreaks.com/topic/269937-mysql-command-not-working-the-way-i-had-hoped/#findComment-1387931 Share on other sites More sharing options...
njdubois Posted October 26, 2012 Author Share Posted October 26, 2012 IS NULL is exactly what I needed! Thank you so very much!!! Nick Link to comment https://forums.phpfreaks.com/topic/269937-mysql-command-not-working-the-way-i-had-hoped/#findComment-1387934 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.