PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?php
select * from tbl_location where l_name = '$location' or l_name = '$location *' or l_name like '%$location'
?>
Lets say I searched for "Stoke-On-Trent" as it is in the database table and i put the search string as "Stoke" - I get "Stoke-On-Trent" but if i serached for "Stoke On Trent" without the "-" i get no result. Why?
If you searched for 'Stoke' you'd find it.
If you searched for 'On' you'd find it.
If you searched for 'Trent' you'd find it.
However, if you search for Stoke On Trent it's searching for that exact phrase, and of course Stoke-On-Trent doesn't match it.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
<?php
$newloc = str_replace(" ","-", $location);
select * from tbl_location where (l_name = '$location' or l_name = '$location *' or l_name like '%$location%' or l_name like '$newloc%')
?>