illegalife Posted February 1, 2009 Posted February 1, 2009 I cant figure out the following query If the user has not done the Example Course then die(You need to finish the Example Course before seeing this page) Need some help asap Thanks! Quote
AlabamaHit Posted February 1, 2009 Posted February 1, 2009 Re: [v2] If course done? if($ir['cdays'] > 0) { die(""); } Quote
gurpreet Posted February 1, 2009 Posted February 1, 2009 Re: [v2] If course done? I cant figure out the following query If the user has not done the Example Course then die(You need to finish the Example Course before seeing this page) Need some help asap Thanks! Something like this (this wont work..) if $ir['cdays'] > 0 { die ("You have not finished the course. You must finish the course before seeing this page.") } Quote
DissObey Posted February 1, 2009 Posted February 1, 2009 Re: [v2] If course done? $cdo=$db->query("SELECT * FROM coursesdone WHERE userid=$userid AND courseid=1"); if($db->num_rows($cdo) == 0) { print "You have not taken the course."; $h->endpage(); exit; } Quote
AlabamaHit Posted February 3, 2009 Posted February 3, 2009 Re: [v2] If course done? The code I gave does work... I have tested it. And if your not talking about making them not be able to see the page when in a course already, then im sorry,thats what i undstood from it....... Quote
Tonka Posted February 3, 2009 Posted February 3, 2009 Re: [v2] If course done? i think he wants someone to have completed a certain course before being able to see a certain page. If that is the case than what DissObey posted will work for him Quote
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.