Re: Searching a MySQL database?

From: Date: Mon, 15 Jan 2001 08:07:59 +0000
Subject: Re: Searching a MySQL database?
Groups: php.general 
Request: Send a blank email to php-general+get-34584@lists.php.net to get a copy of this message
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.
I think you mean $sql = "SELECT * FROM table_name WHERE towns LIKE \"%$town%\" "; The % is more fuzzy. Look it up in the MySQL manual for more details on %. <http://www.mysql.com/doc/> Kristofer -- ______________________________________ Kristofer Widholm Web Pharmacy webpharmacy@brokenhill.net 191 Grand Street, Brooklyn NY 11211 718.599.4893 ______________________________________

« previous php.general (#34584) next »