Inner Join Problem

admin

Administrator
Staff member
I am trying to pull data out of a column named realname from a table named user based on a userid that is associated with the realname in the user table and in a table named calls.

I keep getting the following error:
Column: 'userid' in where clause is ambiguous

I have tried several select statements in the MySQL client, but I can't seem to figure out the correct code.

Thanks.

$display_realname_sql = "SELECT realname FROM user INNER JOIN calls ON calls.userid = user.userid WHERE userid = '$userid'
";
 
Back
Top