I can't seem to get a query to work properly. What I'm trying to do seems simple enough but not simple enough for me I guess. I want to pull fields (login_date, login_time) from a table called login_hist. I also want to pull fields (logout_date, logout_time) from a table called logout_hist WHERE a common field in both tables (member_id) equals the currently logged in member. Here is the code that is returning the query error:
Code: Select all
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
And here is the error:
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
Any help would be greatly appreciated.
C