richrock Posted May 1, 2008 Share Posted May 1, 2008 Hi, having a small issue with a MySQL statement : $querycbpro = "SELECT id, firstname, lastname FROM jos_comprofiler ORDER BY lastname WHERE lastname IS NOT NULL"; But I get a syntax error near WHERE lastname.... Any ideas why? If I remove the WHERE... IS NOT NULL, it works, but inserts a load of NULL values. I want to ignore these. The database was pre-set with the NULL value on the rows, so I can't do much about that. Thanks Rich Link to comment https://forums.phpfreaks.com/topic/103703-solved-stupid-problem-with-null-values/ Share on other sites More sharing options...
rhodesa Posted May 1, 2008 Share Posted May 1, 2008 Edit: oops...WHERE needs to be before ORDER $querycbpro = "SELECT id, firstname, lastname FROM jos_comprofiler WHERE lastname IS NOT NULL ORDER BY lastname"; Link to comment https://forums.phpfreaks.com/topic/103703-solved-stupid-problem-with-null-values/#findComment-530968 Share on other sites More sharing options...
richrock Posted May 1, 2008 Author Share Posted May 1, 2008 I should have realised. Duh. Thanks guys Link to comment https://forums.phpfreaks.com/topic/103703-solved-stupid-problem-with-null-values/#findComment-530976 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.