voxxtelum Posted March 1, 2008 Share Posted March 1, 2008 I have a list of links (surveys) in a table that are displayed in a table after a user logs in. When the user completes a survey, they click on a link on my site that 'completes' the survey and adds it to a separate table which includes the link id and the user id who completed the survey. What I would like to do is when a user looks at the list of links again, they do not see the links they have completed. I am kind of stuck on this and am running out of ideas. Does anyone know a way so that I can select all the links from the completed table where the userids match and somehow use that list (or array rather) to query the links table so that they don't show up? I am not looking for specific code, but maybe just a concept or an explanation. I appreciate the help, Michael Quote Link to comment Share on other sites More sharing options...
soycharliente Posted March 1, 2008 Share Posted March 1, 2008 One option: You could restructure your other table to hold all the surveys that have not been completed instead of the ones that have. As soon as a user registers, it adds rows for all surveys and that user. Once they complete the survey the row can simply be deleted. users ------- user_id username etc. whatever you want surveys ------- survey_id link incomplete ---------- user_id survey_id Now all you have to do is write your query to "SELECT * FROM incomplete WHERE user_id='$var'" I have no idea how your db is structured. I just gave some very basic example db table names and fields. 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.