I'm implementing a "simple" search mechanism to help users find store locations near them. However, I'm having problems with my SQL syntax and I'm hoping that someone here can point me in the right direction.
The problem with the below query is that LIKE is too literal, it only returns rows that match the criteria exactly. I would like some room to fudge around a bit to account for misspellings or similar row results but not exactly the same.
Below is the query I'm using, the $criteria variable is supplied by the user from a form field.
Code: Select all
$selLoc = "SELECT * FROM TableRestaurants WHERE strZip LIKE '%".$criteria."%' ORDER BY strZip ASC";Is what I'm asking for impossible?
Thanks in advance
HG