neilfurry Posted March 6, 2016 Share Posted March 6, 2016 Hi Mate, i need help with my mysql query.. SELECT *FROM `schedules`WHERE `clientID`=''; it doesn't select any values having an empty clientID... there are rows on my database that i need to select that has an empty clientID and using this statement does not return any value... but if i use `clientID`!='' it works fine, it returns all the data having clientID. Any help is highly appreciated. Thank you in advance. Neil Quote Link to comment Share on other sites More sharing options...
QuickOldCar Posted March 6, 2016 Share Posted March 6, 2016 (edited) You may have to trim if is saved as a space in database SELECT * FROM `schedules`WHERE `clientID` is NULL Edited March 6, 2016 by QuickOldCar Quote Link to comment Share on other sites More sharing options...
neilfurry Posted March 6, 2016 Author Share Posted March 6, 2016 I want to select rows that doesnt have clientID's and not that Quote Link to comment Share on other sites More sharing options...
neilfurry Posted March 6, 2016 Author Share Posted March 6, 2016 Yes, correct i want my query to return those rows without clientID's and my query doesnt seem to work... Quote Link to comment Share on other sites More sharing options...
mac_gyver Posted March 6, 2016 Share Posted March 6, 2016 (edited) you will need to attach a partial sql dump of your database table as a file to a reply. this will show us the table definition, in case the definition of that column has something to do with the problem, and it will provide us with the actual data value you expect the query to match. also, how do you know the query doesn't match the data? the method/code you are using to detect if there is a result set may be at fault. Edited March 6, 2016 by mac_gyver 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.