this question has answer here:
i trying use select * statement in php 2 tables. query make following:
$query2="select * london, manchester user = '$row[user]'"; $result = mysqli_query($con,$query2); if try 1 table, london, query works fine. however, when trying query 2 tables following error:
mysqli_fetch_array() expects parameter 1 mysqli_result, here how call result...
while($row = mysqli_fetch_array($result)) { results.... } upon looking exact reason error message occurs being told "column 'user' in clause ambiguous".
for simple statement, try using mysql union.
select * london user = '$row[user]' union select * manchester user = '$row[user]' or pdo...
select * london user = :user union select * manchester user = :user ...and bind :user variable.