jnerotrix Posted December 8, 2008 Author Share Posted December 8, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/135982-need-help-with-php-mysql-wether-to-display-or-not/page/3/#findComment-709989 Share on other sites More sharing options...
gevans Posted December 8, 2008 Share Posted December 8, 2008 Sorry, I'm getting really stuck on this!! Quote Link to comment https://forums.phpfreaks.com/topic/135982-need-help-with-php-mysql-wether-to-display-or-not/page/3/#findComment-710015 Share on other sites More sharing options...
fenway Posted December 9, 2008 Share Posted December 9, 2008 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 "; Quote Link to comment https://forums.phpfreaks.com/topic/135982-need-help-with-php-mysql-wether-to-display-or-not/page/3/#findComment-710564 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.