PHP MYSQL search for postcode using LIKE -


i have query searches postcode using like. postcode fine if puts full postcode e.g. sw14 4np. if put in sw1 return sw1+ results. how can make if put sw1, display sw1 postcode , not sw11, sw14 etc.

my query is:

select postcode data postcode '$search%' 

the database postcodes stored sw14 4np etc space.

use regular expression based pattern matching:

where postcode rlike '^$search( ?[0-9][a-z]{2})?' 

Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -