gmc1103 Posted February 4, 2016 Share Posted February 4, 2016 I have this table Field Type Comment idsala int(11) NOT NULL sala varchar(45) NOT NULL estado tinyint(1) NOT NULL And i want to avoid 3 records from the database I'm using this query but those records are showed SELECT `idsala` , `sala` FROM `req_material_sala` WHERE (`idsala` !=23) OR (`idsala` !=24) OR (`idsala` !=39); Any help please? Quote Link to comment https://forums.phpfreaks.com/topic/300732-mysql-query-help/ Share on other sites More sharing options...
Solution Barand Posted February 4, 2016 Solution Share Posted February 4, 2016 Use AND instead of OR. Alternatively, ... WHERE idsala NOT IN (23,24,39) Quote Link to comment https://forums.phpfreaks.com/topic/300732-mysql-query-help/#findComment-1530755 Share on other sites More sharing options...
gmc1103 Posted February 4, 2016 Author Share Posted February 4, 2016 Hi Barand Thank you again. Best regards Quote Link to comment https://forums.phpfreaks.com/topic/300732-mysql-query-help/#findComment-1530756 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.