Click here to Skip to main content
14,240,831 members
Rate this:
Please Sign up or sign in to vote.
See more:
how can I use php to display question stored in mysql database and choose the right answer for it and give grade if the answer is right and store it back in mysql database (sorry I don't speak English very well)
Posted
Updated 13-Dec-15 8:23am
v2
Comments
Suvendu Shekhar Giri 13-Dec-15 14:13pm
   
Where you are stuck?
What have you tried so far?
mohammed nasyia 13-Dec-15 14:44pm
   
i have created database for my questions
===Database test

== Table structure for table question

|------
|Column|Type|Null|Default
|------
|id|int(3)|No|
|question|varchar(100)|No|
|ans1|varchar(50)|No|
|ans2|varchar(50)|No|
|TrueAns|varchar(30)|No|
== Dumping data for table question

|10|how we define variables in php language ?|#s|$S|$s
== Table structure for table question
and i have this code for search and displaying data but i don't know if it's useful
0){



while($row = mysql_fetch_array($query)){
$id = $row['id'];
$question = $row['question'];
$ans1 = $row['ans1'];
$ans2 = $row['ans2'];




echo"$question <br>";
echo"<input type='radio' value='A'>$ans1<br> ";
echo"<input type='radio' value='B'>$ans2 ";


}


} else{
echo " لا توجد نتيجة ";
}
}
}
}
exit;
?>

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100