I want to be able to match a field in Table1 and echo data from Table1 along with the matching fields in Table2. I tried the below but did not work.
Example:
I want to echo data in this order: items(Table1), category(Table1), preice(Table2), buyer(Table1)
$serchRslt = "fr732001";
$result = mysql_query("SELECT Table1.items, Table1.category, Table1.buyer, Table2.price, Table2.stocks Table2
LEFT OUTER JOIN Table1 ON Table2.item = Table1.items FROM Table1 WHERE Table1.items = '".$serchRslt."'");
while($line = mysql_fetch_array($result)) {
echo $line["items"];
echo $line["category"];
echo $line["price"];
echo $line["buyer"];
}
Expected result: fr732001 fruits 3.20 AS1