Hello,
I'm trying to perform relatively simple PHP full text search on a MySQL database -- but I'm a newbie with some newbie problems.
The site revolves around some photographs taken from my travels, and the MySQL database includes a city field and a description field.
In its current rendition, it can be viewed here:
http://www.sct-online.com/swphoto/search.html
The city drop down menu has been disabled, but if you search for some text it will work properly.
Now, I want to add a bit of code so that if you search for some text AND select a city, then the results will be reduced by those images which have descriptions similar to your search and are in the city indicated.
My current PHP select routine looks like this:
$SQL="SELECT * FROM uk WHERE match(city, description) against('$searchquery' IN BOOLEAN MODE) ORDER BY number ASC";
I also have a variable for the city selection when chosen -- $city.
However, if I use the following bit of code, I get 0 results every time.
$SQL="SELECT COUNT(*) AS Total FROM uk WHERE 'city' LIKE '%$city%' AND match(city, description) against('$searchquery' IN BOOLEAN MODE)";
For example, if you go to the site and search for "seth" without selecting a city, you will see 5 results -- 3 of which are in London. However, if I use the bit of code above and select London from the drop down menu, I get 0 results?
Thoughts? Any help greatly appreciated.
Seth