Login Register






Result Shuffling problem in Mysql filter_list
Author
Message
RE: Result Shuffling problem in Mysql #5
@invisal I am not famailar with PDO hence I'm getting this error "Call to a member function prepare() on a non-object"

Here's my code:

Code:
<?php if (isset($_POST["answer"])) { // check for correct answer, you need to query // the question and answer again to compare //global $prepare; $sh = $db->prepare("SELECT * FROM mcqs WHERE question LIKE '%$sub%'"); $sh->bindValue("$sub", $_POST["question_id"]); $question = $sh->fetch(); } else { $sh = $db->prepare("SELECT * FROM mcqs ORDER BY RAND() LIMIT 1"); $question = $sh->fetch(); } ?>

I've edited your code according to my needs. I am totally mind boggled at the moment since I have a deadline till Monday and I want this to get solved today :S

P.S IF you want I can send you my whole script
My Blog: http://www.procurity.wordpress.com
Donations: 1HLjiSbnWMpeQU46eUVCrYdbkrtduX7snG






Messages In This Thread
Result Shuffling problem in Mysql - by Ex094 - 04-11-2014, 07:00 PM