Hi
can anyone tell me how i can achieve this?
i have a list of phone numbers some have spaces in them like 123 9876 and some dont. Is there any way of getting it to ignore the spaces in MySQL when quaried from the search site? So users can find the numbers typing the space or not.
Thanks.
two good choices 1) clean all phone numbers before insert and then reformat to a standard when displaying them
2) insert the phone number given and save a second 'clean' number in a separate column. When searching clean the search number and compare to the clean column only. When presenting back to the user show the actual number for the records found.
I would prefer to achieve this by code. I know PHP/MySQL can do this, but I dont know how.
thanks
If anyone wants to see how i am doing the search heres the code
if($company_name or $phone or $company_keywords or $post_code) { $query="SELECT * FROM company_details WHERE";
if ($phone!="") { $query.=" phone LIKE '%$phone%'"; }
cheers