Is there a way to do a SQL query with a wildcard or search for with contain.
Currently users can search my database for an address. Using the LIKE command they can search for 123 Fake St. But is there a way to perform a search using 123, and then have it display all the addresses that have 123 in them. Example: Search for 123 -> Results: 123 Fake St, 123 Spooner Ave, 123 Example Terrace.
Is there a way to perform a search like that? My code for the current search function is below: On the previous page the user enters an address they want to search for, that value is stored in $street.
$sql = ("SELECT sitestreet FROM `PropertyInfo` WHERE `sitestreet` LIKE '$street' AND `user` LIKE '$user'");
$result = mysql_query($sql);
Thanks!
The sql wildcard is ‘%’ use that within a like