Hi i am new to this, first time joined a forum. Anyway my problem is i have two tables:
table1: establishment(estNo mediumint, estName varchar, other details..) Primary key=estNo;
table2: foodType(food varchar(), estNo mediumint) Foreign key=estNo, Primary Key=(food, estNo);
user inputs: inputEstName for establishment and inputFood for foodType;
im trying to set up a query via php that does the following:
SELECT all establishment details from establisment
ONLY IF
establishment.estName=inputEstName;
foodType.estNo=establishment.estNo && foodType.food = inputFood;
(where I get the estNo when a record has been found for the estName input)
the query in php that i have got so far looks like this:
$select= "select estNo, estName, details from establishment
where estName=" . $inputEstName .
"AND establishment.estNo=foodType.estNo
AND foodType.food=" . $ inputFood;
Help would be much appreciated,
Eric
When you are in a forum the very first time: READ THE POSTING GUIDELINES!!, especially the part on enclsosing code with php, html ot code tags!! - Ronald