Jump to content

Dynamic List based on Data from Two Tables


DjMikeWatt

Recommended Posts

So, I want a user to be able to leave feedback on any project that belongs to them.  I want a LIST to display all the available projects for them to select which one they want to comment on.

 

The 'users' table contains the user's email address, which is also their session username (users.email = $_SESSION['MM_Username']).  This table also contains the user's primary key, which is 'uid'.

The 'projects' table contains the projects, and each entry has a 'client_id' which matches the user's 'uid' from the 'users' table.

 

What's the best query string to populate this LIST based on this data?  I was trying:

SELECT project_id, client_id, project_type, project_description, uid, email
FROM projects, users
WHERE email = 'colname' AND uid = client_id

Where 'colname' was defined as $_SESSION['MM_Username']

 

but I'm getting nothing.  I get no errors, but the list is just empty.  Any thoughts?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.