Question
post code search
Bear with me...
I have a MySQL table which contains a list of cities, the URL of their corresponding image (ie a pic of that city) and the first letters of the post codes of that city (eg CF for Cardiff, B for Birmingham).
I have a search form which allows users to search for businesses by name and city or postcode.
I want to insert a dynamic image of the city searched for. So far, if the user types "Cardiff" or "cardiff" or "car", the correct image appears. If he types "CF" or "cf", he gets the right image. BUT if he types "CF24 4AA", he gets nothing.
In the query advanced panel the SQL looks like this:
SELECT *
FROM cities
WHERE cityforpic LIKE TownPic% OR PostCodeStart LIKE PostC%
Both variables TownPic and PostC are text, GET their data from the same text field, and are set to default value -1.
So what am I doing wrong???????
I am wellllllll past my deadline on this one, so any URGENT help greatly appreciated and will be rewarded with cyber-cocoa and biscuits! 😜
I have a MySQL table which contains a list of cities, the URL of their corresponding image (ie a pic of that city) and the first letters of the post codes of that city (eg CF for Cardiff, B for Birmingham).
I have a search form which allows users to search for businesses by name and city or postcode.
I want to insert a dynamic image of the city searched for. So far, if the user types "Cardiff" or "cardiff" or "car", the correct image appears. If he types "CF" or "cf", he gets the right image. BUT if he types "CF24 4AA", he gets nothing.
In the query advanced panel the SQL looks like this:
SELECT *
FROM cities
WHERE cityforpic LIKE TownPic% OR PostCodeStart LIKE PostC%
Both variables TownPic and PostC are text, GET their data from the same text field, and are set to default value -1.
So what am I doing wrong???????
I am wellllllll past my deadline on this one, so any URGENT help greatly appreciated and will be rewarded with cyber-cocoa and biscuits! 😜
