| | |
mutliple entries in search box
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jan 2008
Posts: 62
Reputation:
Solved Threads: 6
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
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
php Syntax (Toggle Plain Text)
$category=$_GET['cat']; $text=$_GET['text']; $query=mysql_query(" SELECT * FROM event_information WHERE category='" . $category . "' AND keywords LIKE '%" . $text . "%' 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
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
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*
![]() |
Other Threads in the PHP Forum
- Previous Thread: Neural Network training...
- Next Thread: Confusion with Zoomla Installation
| Thread Tools | Search this Thread |
ajax apache api archive array autocomplete beginner binary broken cakephp checkbox class cms code cron curl database dataentry date display duplicates dynamic echo email emptydisplayvalue error errors execute explodefunction file files firstoptioninphpdroplist folder form forms function functions google href htaccess html image include insert integration ip java javasciptvalidation javascript joomla keywords limit link login mail matching menu mlm multiple mysql oop paypal pdf php phpincludeissue problem query radio random recursion recursive regex remote script search server sessions shot sms soap source space sql subscription syntax system table tag tutorial tutorials update upload url validator variable vbulletin video web xml youtube






