searching by _'s problem :(
| From: | Sandeep Hundal | Date: | Sat, 02 Dec 2000 04:15:04 +0000 |
| Subject: | searching by _'s problem :( | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-28337@lists.php.net to get a copy of this message | ||
Hi list,
i've got a small problem. ok two small problems.
i've made a small search box which searches by local town and
postcode. the town is fine, but postcode is giving me hassle.
firstly i need to convert the value i get from the form, so it has no
spaces in between (as thats how they are stored in the mysql for
various reasons.
i use:
$srch = str_replace(' ','',str_replace('.','',$srch));
$srch = "%".$search."%";
to get rid of the spaces, and then to make the search wide ranging.
Problem - the first bit doesnt work, and $srch still has a space in
between :(
Also, english postcodes are like: AA1 5AA . Even if i convert it to
"AA15AA", what I need to do is put 3d and 4th letters as wildcards
("_" in sql i hear). But how can I if its a variable ??? :((
Any help would be nice!!
TIA!
/sunny
__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/