Hi
I have a UK postcode broken down into two database fields:
postcode1 and postcode2.
What I want to be able to do is to query the database from a form and return customers from the complete postcode entered on the web form.
I am trying this sort of thing at the moment but it's not happening. Just getting an error. "you have an error in your SQL syntax "
Am I nearly there? Any help appreciated! Many thanks!
I have a UK postcode broken down into two database fields:
postcode1 and postcode2.
What I want to be able to do is to query the database from a form and return customers from the complete postcode entered on the web form.
I am trying this sort of thing at the moment but it's not happening. Just getting an error. "you have an error in your SQL syntax "
Code:
$query= "SELECT CONCAT('postcode1', 'postcode2') AS c_postcode FROM customer
WHERE c_postcode = '$_POST[new_search]";
Am I nearly there? Any help appreciated! Many thanks!