| | |
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
Views: 587 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl database date datepart directory display download dynamic echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla jquery limit link list login loop mail menu methods mlm mod_rewrite multiple mysql oop parse password paypal pdf php problem query radio random recursion regex remote script search select seo server sessions sms soap source space speed sql structure syntax system table tutorial update updates upload url validation validator variable video web webdesign xml youtube






