Hello! 🙂
I do have this form on page1
Categories (drop down meny)
all categories(value=allcats)
bakeries
plumbers
etc
Towns ( drop down meny)
all towns(value=alltowns)
London
Newcastle
etc
Company Name (textfield)
Then one page 2 I have
if ($category=="allcats")
$strCategory = "";
else
$strCategory = "OR category = '" . $category . "'";
if ($town=="alltowns")
$strTown = "";
else
$strTown = "OR town = '" . $town . "'";
$Query="SELECT * FROM companies WHERE name LIKE '%" . $companyname . "%' " . $strCategory . $strTown;
My problem is that even if another town is chosen, hits from all towns is presented, the same problem with categories. 🙁
I have checked with echo on page two that the variables $town and $category really have values from the drop down menus.
Any ideas please?