iamnoob Posted March 25, 2004 Share Posted March 25, 2004 Using Dreamweaver, php, mySQL I have to make a quiz, with just 1 question and 1 answer. Firstly I've created the database Name: questionaire Table: checkfyp Fields: Question and Answer The form only consist a question, and a textbox. Connection from dreamweaver to mySQL is currently working. I could insert , delete, login and such stuffs. I have no idea how to compare the user input with mySQL. If correct -> /quiz/correct.php else -> /quiz/incorrect.php I'm a newbie in php..please help.. Quote Link to comment https://forums.phpfreaks.com/topic/1757-php-mysql-quiz/ Share on other sites More sharing options...
PHP Monkeh Posted March 25, 2004 Share Posted March 25, 2004 <?php // Connect to database Put your database connect stuff here // Quiz checking $query = "SELECT * FROM checkfyp"; $result = mysql_query($query) or die(mysql_error()); while($r = mysql_fetch_array($result)) { if($r[Question] == $user_submitted_Question) { Make page re-direction here to correct.php; } else { incorrect.php } } ?> Hope you can understand this Quote Link to comment https://forums.phpfreaks.com/topic/1757-php-mysql-quiz/#findComment-5727 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.