Hi,
Here's what is intended:
Try to find a store where the user's input matches with table stores fields.
I will give here an example of what's intended.
Thanks in advance for any help.
Variables from user's input:
$storename
$city
$owner
The first query:
$query="SELECT * FROM stores WHERE name LIKE '%$storename%' AND city LIKE '%$city%' AND owner LIKE '%$owner%'";
$result=mysql_query($query) or die("ERROR: ".mysql_error());
while($fields=mysql_fetch_array($result)){
$storeID0$fields["ID"];
$store=$fields["storename"];
$owner=$fields["owner"];
<table>...printing the results...</table>
<? } ?>
Now, that we have these results, we would like to enable the user to search bit more in table caracteristics within the storeID results from the previous query, not using table joins but arrays since the user is in another page now (The results page).
$query="SELECT * FROM caracteristics WHERE storeID='$storeID' AND location LIKE '%$location%' AND has_rice='yes' AND has_bread='yes'";
$result=mysql_query($query) or die("ERROR: ".mysql_error());
while($fields=mysql_fetch_array($result)){
$storeID0$fields["ID"];
$store=$fields["storename"];
<table>...printing the results...</table>
<? } ?>