RyanSF07 Posted August 7, 2010 Share Posted August 7, 2010 Hi All, I have a several hundred "quizzes" in a database that I need to go through. All of the quizzes are multiple choice and based on a video. Typically I go through these one by one. Over the past few months I haven't been as diligent and the quizzes have piled up for moderation. I was going through this morning and quickly saw that most of these (they are User Generated) don't have more than 2 questions. That is, quite a few of them appear to be 'test' quizzes by users.. just to see how the quiz builder works. Anyhow, if they are good quizzes / quality content I push them to the site. If not I disable them. I need help with a sql query -- I'd like to run this in php my admin and view all quizzes with 2 questions or less and with a "pass text" set to "new_quiz". Then I plan to update the "new_quiz" value to "disabled" to remove them from the moderation cue. Here's how I pull the video from the database: "SELECT * FROM video, registered_users WHERE video.id = '$_GET[id]' AND video.user_id = registered_users.id"; Here's how I pull quizzes/questions from the database: $display = mysql_query("SELECT * FROM quiz WHERE quiz.video_id = '$_SESSION[get]' ORDER BY id ASC"); Questions are in the quiz table in a row called "question" Could you please offer some help as to the best way to write this query? In plain speak I think it ought to be: select * from table-video and table-quiz where video.id = quiz.video_id and video.pass_text= "new_quiz" and there are equal to or less than 2 questions related to this video. What is the best way to write this? Please help and I'll test the query on backup db. thanks so much! Ryan Quote Link to comment Share on other sites More sharing options...
RyanSF07 Posted August 7, 2010 Author Share Posted August 7, 2010 nevermind -- I've been looking into this and I see it's much more info would be required before you'd be able to help. Not only that, my "plain speak" phrase above wouldn't work. I'll keep at it : ) 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.