BigTime Posted August 20, 2013 Share Posted August 20, 2013 I would like to do a join I think? Not sure if Im going about this the right way, and unsure how to format the query.In one table I have a field called name - I'd like to call all of them - then query another table for any results that exist with that name,and if so show them all grouped together, and if not, then show the name in RED (or whatever).This is basically have they submitted or not.so table1:nameSelect DISTINCT name from table1 ORDER by name ASCthen table2:id (not the same as the first table)user (which will match name)weekdescriptionSELECT * from table2 WHERE (user='$name' AND week='$week')Then visible results loop looks somthing like:WEEK 1NAME1 DESCRIPTION IDNAME1 DESCRIPTION IDNAME1 DESCRIPTION IDNAME2 DESCRIPTION IDNAME2 DESCRIPTION IDNAME2 DESCRIPTION IDNAME3 DESCRIPTION IDNAME3 DESCRIPTION IDNAME4 NO SUBMISSION FOUNDNAME5 DESCRIPTION IDNAME5 DESCRIPTION IDDo I need to do the first query and then a foreach loop? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.