Jump to content

Need help with php / mysql wether to display or not


jnerotrix

Recommended Posts

This is with only 1 survey completed (by this user)

 

 

b9521aad02a2687525db14f43f8662ea Member Id

 

b9521aad02a2687525db14f43f8662ea end of test <-- in this its reading all the member_id in completed_survey

 

its supposed to check if $memberid is in there and check if  $memberid matches member_id and if they match do not display that survey id

 

 

Link to comment
Share on other sites

  • Replies 52
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

it shouldnt show if survey wasnt completed it should show if survey wasnt completed by user

Please stop posting all of the code over & over again... this is a one-line query issue.

 

You need to limit your query to refer to member_id -- I assume you know who is logged in?

 

$query = "select surveys.id, survey.title, survey.adlink from survey left join completed_surveys on ( survey.id = completed_surveys.survey_id AND completed_surveys.member_id = <the-logged-in-user-id> ) WHERE completed_surveys.survey_id IS NULL ";

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.