ramli Posted January 10, 2009 Share Posted January 10, 2009 I have the following querys: query1: SELECT * FROM gebruikers INNER JOIN klas ON gebruikers.Klas_ID = klas.Klas_ID WHERE Actief = '1' AND Gebruikersrol = '2' AND Jaar = '2009' query2: SELECT * FROM gebruikers INNER JOIN klas ON gebruikers.Klas_ID = klas.Klas_ID WHERE Gebruikersnaam LIKE '%raman%' OR Voornaam LIKE '%raman%' OR Achternaam LIKE '%raman%' OR Tussenvoegsel LIKE '%raman%' OR Klasnaam LIKE '%raman%' AND Actief = '1' AND Gebruikersrol = '2' AND Jaar = '2009' When i add the FIND to the query it ignores the Gebruikersrol, Actief and Gebruikersrol restriction and display's all records. I want to search the database with the restrictions in place. What am i doing wrong? any help will be much apreciated. Link to comment https://forums.phpfreaks.com/topic/140319-solved-find-override/ Share on other sites More sharing options...
corbin Posted January 10, 2009 Share Posted January 10, 2009 You probably need parenthesis around some of your AND and OR clauses. Link to comment https://forums.phpfreaks.com/topic/140319-solved-find-override/#findComment-734257 Share on other sites More sharing options...
ramli Posted January 10, 2009 Author Share Posted January 10, 2009 Could you pleace give me a example... my english ist that great... i dont know what a parenthesis is.. Thx in advance... Link to comment https://forums.phpfreaks.com/topic/140319-solved-find-override/#findComment-734260 Share on other sites More sharing options...
ramli Posted January 10, 2009 Author Share Posted January 10, 2009 Looked it up in the dictionary and tryed.. SELECT * FROM gebruikers INNER JOIN klas ON gebruikers.Klas_ID = klas.Klas_ID WHERE (Gebruikersnaam LIKE '%test%' OR Voornaam LIKE '%test%' OR Achternaam LIKE '%test%' OR Tussenvoegsel LIKE '%test%' OR Klasnaam LIKE '%test%') AND Actief = '1' AND Gebruikersrol = '2' AND Jaar = '2009' and it works perfectly. Thx for the help. Link to comment https://forums.phpfreaks.com/topic/140319-solved-find-override/#findComment-734262 Share on other sites More sharing options...
corbin Posted January 10, 2009 Share Posted January 10, 2009 Link to comment https://forums.phpfreaks.com/topic/140319-solved-find-override/#findComment-734277 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.