mutliple entries in search box

Reply

Join Date: Jan 2008
Posts: 62
Reputation: hooray is an unknown quantity at this point 
Solved Threads: 6
hooray hooray is offline Offline
Junior Poster in Training

mutliple entries in search box

 
0
  #1
Jan 25th, 2008
I have a search box on my website, that allows users to look for items that have been posted by other users, I am using this code a the moment, but there is a problem with it
  1. $category=$_GET['cat'];
  2. $text=$_GET['text'];
  3. $query=mysql_query("
  4. SELECT *
  5. FROM event_information
  6. WHERE category='" . $category . "'
  7. AND keywords LIKE '%" . $text . "%'
  8. LIMIT 0, 25");

The problem with this is that say someone was searching for 'chris rock live' and there was an entry it would be fine, bt if they searched for 'live chris rock' then they would not get anything from the database. Is there a way using php that I can take their query and set an array or something to hold the values of each word separatley and include each word in the query

Thanks for looking
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,266
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 377
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: mutliple entries in search box

 
0
  #2
Jan 26th, 2008
I think to do that, it is going to be more effort than it's worth, but then what do I know. LOL

Maybe
http://dev.mysql.com/doc/refman/5.0/...function_match
Last edited by iamthwee; Jan 26th, 2008 at 4:05 pm.
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC