943,749 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 774
  • PHP RSS
Jan 25th, 2008
0

mutliple entries in search box

Expand Post »
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
php Syntax (Toggle Plain Text)
  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
Reputation Points: 11
Solved Threads: 6
Junior Poster in Training
hooray is offline Offline
62 posts
since Jan 2008
Jan 26th, 2008
0

Re: mutliple entries in search box

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.
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Custom Thread Module
Next Thread in PHP Forum Timeline: Confusion with Zoomla Installation





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC