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 Quote Link to comment 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"; Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.