so the query below will run in my phpmyadmin (with the variables as actual values as course), but when I run it in my php code I only get the first field returned (as if the second query after the UNION was never run).
$result=mysql_query("(SELECT RID, Name, Address, City, State, Zip_Code, Phone
FROM restaurant
WHERE Name = '$sql_name' AND City = '$sql_location')
UNION
(SELECT RID, Name, Address, City, State, Zip_Code, Phone
FROM restaurant
WHERE Name = '$sql_name' OR City = 'sql_location') ");
Can anyone help me as to why this is? Thanks for reading and I appreciate any and all help.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…