Patience please...
I'm at a severe disadvantage living in a trailer in the hills without internet access. My question is not frivolous and is the last thing I need to get things up and online.
I am presently at an internet wireless cafe and may not even see replies for another week. Thank you very much for you help. I've figured many other things else out alone but I am stuck.
SUBJECT: Search Box
I have an MYSQL database with at least two (preferably three or more) columns I want users to search.
I am using an HTML form with single textbox named "search".
The two most important database columns are called 'description' and 'keywords'...
'description' holds information such as Joe's Hardware Sillytown USA
'keywords' holds information such as hammer, nails, saws etc.
GOAL: To have user able to type in two or three words and be able to search on them.
Ideally I would like to use a query such as...
$sql = "select * from sites WHERE description LIKE '%$search%' AND keywords LIKE '%$search%'";
...user would be inputting something like 'Seattle hammers' or 'hammers Seattle' into the search box.
The above QUERY works from the command line with known hardcoded in data but not from the script using variable %$search% (or %$search or $search or anything else) and, of course, I've tried everything I can think of.
and also
user inputs 'hammers saws' and have all results with either hammers and/or saws return.
I've tried using a regex to split $search...
$search=$_POST['search'];
$search2=split(' ',$search);
but I'm not having any luck with this method probably because I can't get MYSQL to work with the array from $search2.
I can do an "Advanced Search" but need an effective front line search, anything to buy time for a more elegant solution. Thank you very much in advance!
Richard