Can somoeone help a newbie please?
I have a database of members. One table has fields - ID, name, contacts, details, region
On the website I have forms that allows users to search for name or region or interest
I have no problem wrting a php script to show all members or to select all in one region but cannot get any script to work by selecting by name using WHERE name LIKE '%'
The users use the form to search for members by name i.e. they fill in the text box with part of a name e.g. williams and I want the script to find and display all the members whose names contain the text "williams"
If i take aout the WHERE clause then the script works fine (albeit returning all members) so I think it must be that WHERE statement that is fouling things up.
This is the "action" part of my script
$resultID = mysql_query("SELECT name, contacts, details FROM -members WHERE name LIKE '%'", $linkID);
I also have a form that allows visitors to search for members with particular interests. Thus is a user typed "art" into the form the mysql query should seek and display all members who list art amongst their interests.
Quite simply how can I write a query to find arbitary character strings in fields.
I hope this makes sense and that someone can help me PLEASE because it is driving me nuts