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

 

 

  • Replies 52
  • Created
  • Last Reply

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 ";

Archived

This topic is now archived and is closed to further replies.

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