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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.