Column 'user_id' in field list is ambiguous
Per Readie's comment . . . it's ambiguous because you need to specify the table to which you are referring, there are two field names with user_id present (example below.)
The thing about joins is they will return results whether or not the values of the joined tables are null, which is sometimes what you want. Sometimes it's not. :-)
For example, if there are no entries in the joined table relating to the first table, a join will give you "field 1 field 2..." and NULL NULL NULL for the non-existent corresponding entry.
You can add a "not null" to the where, or,
$sql = "select projects_tb.user_id, projects_tb.project_id, projects_tb.projectname, projects_tb.projectdeadline, projects_tb.projectdetails
FROM projects_tb,usersprojects_tb,users_tb where
projects_tb.user_id=users_tb.user_id and usersprojects_tb.project_id=projects_tb.project_id and projects_tb.user_id = '".intval( $_SESSION['SESS_USER_ID']);
May have some of the specific fields incorrect, but that's the concept . . . this will not return any results if any of the values in the joined tables are null.
[edited by: rocknbil at 9:10 pm (utc) on Mar 15, 2010]