Richzilla Posted May 20, 2007 Share Posted May 20, 2007 When conducting a php sql search i get some great results, however i want to expand my results so that when multiple search terms are added it will display all relevant fields. $query = "SELECT * FROM Mixes WHERE dj LIKE '%$var%' OR event LIKE '%$var%' OR tracklist LIKE '%$var%' OR date LIKE '%$var%' ORDER BY event ASC"; From the above search i can only get single results from 1 field. I want to be able to seperate the search term into individual items that can be referrenced in the database. So for example i search for a dj name and also an event they play at i get zero results, however if i search for them individually i get the results i want. How do i expand the code to display the result of both the dj and the event or any of the other fields? I presume that i need to be able to set each search item into an individual variable and then use them to search. Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/52267-seperating-search-items/ Share on other sites More sharing options...
Barand Posted May 21, 2007 Share Posted May 21, 2007 my method http://www.phpfreaks.com/forums/index.php/topic,135322.msg571164.html#msg571164 Quote Link to comment https://forums.phpfreaks.com/topic/52267-seperating-search-items/#findComment-257931 Share on other sites More sharing options...
Richzilla Posted May 21, 2007 Author Share Posted May 21, 2007 I'm not using checkboxes or specific feilds to destinguish between columns. It's just standard search box. I want to search for any number of different values. Effectively i need to use a AND/OR statement for the selection of the fields, however i don't think this is possible. Quote Link to comment https://forums.phpfreaks.com/topic/52267-seperating-search-items/#findComment-258183 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.