Can anyone tell me what I would use to query a MySQL database in a search?

If the search field, was for example, a variable like "town", would the
results page use something like this? :

$sql = " SELECT * FROM table_name
        WHERE towns = \"$town\" ";

I remember seeing someone post something like this:

$sql = " SELECT * FROM table_name
        WHERE towns LIKE \"$town\" ";

so if the search word is not EXACTLY like a row in the database, it may
return results to partial words.

Thanks in advance,

James.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to