Monday, 15 September 2014

php - mysql postcode search -



php - mysql postcode search -

evening all.

i have mysql database property website. there search form people can come in location or postcode in same field.

part of sql

postcode '$loc%

put problem people come in post code : "l236yt" , space "l23 6yt".

the database contains postcodes space in them how can create work or without space ??

any help appreciated

thanks baz

assuming values in database without space, sanitize user value value without space:

$val = str_replace(' ', '', $val);

php mysql

No comments:

Post a Comment