DjMikeWatt Posted August 6, 2008 Share Posted August 6, 2008 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 https://forums.phpfreaks.com/topic/118376-dynamic-list-based-on-data-from-two-tables/ Share on other sites More sharing options...
secoxxx Posted August 6, 2008 Share Posted August 6, 2008 uid = '$client_id' try that for the client uid, im not 100% sure what you want to do though Link to comment https://forums.phpfreaks.com/topic/118376-dynamic-list-based-on-data-from-two-tables/#findComment-609312 Share on other sites More sharing options...
fenway Posted August 6, 2008 Share Posted August 6, 2008 where is the join condition???? Link to comment https://forums.phpfreaks.com/topic/118376-dynamic-list-based-on-data-from-two-tables/#findComment-609585 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.