I am trying to get rows from 2 tables in the same query. I have a common field in both tables called "member_id". The following error message is being returned when I run the query and I don't know why.
Invalid query: Column 'member_id' in where clause is ambiguous Whole query: SELECT * FROM login_hist,logout_hist WHERE `member_id` = '4' ORDER BY `login_date` DESC, `login_time` DESC
This is the php code that generates the error:
Code: Select all
$query = "SELECT * FROM login_hist,logout_hist WHERE `member_id` = '$mbr_id' ORDER BY `login_date` DESC, `login_time` DESC";