m00ch0 Posted September 14, 2007 Share Posted September 14, 2007 "SELECT * FROM scontrol WHERE scan LIKE '%$search%'" Currently its only search through scan as you can see above thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/69340-solved-how-do-i-search-through-all-of-my-database-fields/ Share on other sites More sharing options...
Fadion Posted September 14, 2007 Share Posted September 14, 2007 u mean: "SELECT * FROM scontrol WHERE scan LIKE '%$search%' AND print LIKE '%$search%' AND open LIKE '%$search%'" Quote Link to comment https://forums.phpfreaks.com/topic/69340-solved-how-do-i-search-through-all-of-my-database-fields/#findComment-348405 Share on other sites More sharing options...
Jessica Posted September 14, 2007 Share Posted September 14, 2007 I think you'd want to use OR, not AND. Quote Link to comment https://forums.phpfreaks.com/topic/69340-solved-how-do-i-search-through-all-of-my-database-fields/#findComment-348413 Share on other sites More sharing options...
m00ch0 Posted September 18, 2007 Author Share Posted September 18, 2007 Thanks alot works prefect i used the Or insted of and cheers Quote Link to comment https://forums.phpfreaks.com/topic/69340-solved-how-do-i-search-through-all-of-my-database-fields/#findComment-350372 Share on other sites More sharing options...
AV1611 Posted September 18, 2007 Share Posted September 18, 2007 select * from table where field='blah' and field2='blah' or (field='blah' and (field3='blah' or (field4='blah' or isnull(field5)))) (WAY too much coffee this morning...) Quote Link to comment https://forums.phpfreaks.com/topic/69340-solved-how-do-i-search-through-all-of-my-database-fields/#findComment-350401 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.