I have a database setup and can connect to the table in the database. ( That is huge for me
Now I want to be able for quiz takers to enter in an password that will load/show a particular quiz question.
So for example, if they have completed a questions, they are given the passsword of the next one that they enter into a text box.
Then when they submit the password correctly they are given the question that corresponds to that identifyer.
My database has several columns in it:
question_id question_pass question_text question_ans
So basically when they enter in a given password they get the correct question, if they answer it correctly they are given the next passoword...
Any hints or ideas would be appreciated:
Thanks
Below is just what I have so far to connect and display one question.....
Code: Select all
//connection check to database and database welcome information
mysql_connect("localhost", "user", "password") or die(mysql_error());
echo "Connection to Server...<br/>";
mysql_select_db("quiztest") or die(mysql_error());
echo "Database Active!<br/>";
// Collects data from quiztest "questions" table data
$data = mysql_query("SELECT * FROM questions")
or die(mysql_error());
// puts the "questions" info into the $info array
$info = mysql_fetch_array( $data );
// Print out the contents of the entry
Print "<br><b>Question1:</b><br> ".$info[question_text'] . " ";