Online Exam

hello friends i want to build an online examination site , but i am confused about database ,how to check correct ans.
Can anyone help me out.

What exactly are you confused about. Show us what you’ve got so far, and what the problem is.

merry christmas guido, basically i want to create module of online exam,for this purpose i have to create table for questions and ans. ,but i don’t understand
that ,all questions and ans. column are created in same same row of a table,or i have to build other tables,and how to check ans. through database.

Hi e.udaikr, welcome to the forums.

Not only do you not have to have everything in one table, you shouldn’t. Trust me I know. Been there, done that, and it wasn’t pretty.
Unless it’s for learning purposes and will only ever be simple and small - and even then if you want to learn correctly - you need to think about what kind of information you’ll need and the inter-relationships they have and then create tables for each “unit” as it were.

For example
Will each question have only one answer?
only one correct answer?
will each answer belong to only one question?

hello friends i have done some part,questions and ans,
my table code is

$query = "CREATE TABLE IF NOT EXISTS `exam`(
					`id` int(11) NOT NULL AUTO_INCREMENT,
					 `question` varchar(200) NOT NULL,
					 `a` varchar(200) NOT NULL,
					 `b` varchar(200) NOT NULL,
					 `c` varchar(200) NOT NULL,
					 `d` varchar(200) NOT NULL,
					 `ans` INT(20) NOT NULL,
					 `added_date` datetime NOT NULL,
					 `status` enum('0','1') NOT NULL,
					 PRIMARY KEY (`id`)
		mysql_query($query) or die(mysql_error());
		mysql_select_db($db_name) or die(mysql_error());

and from this i have inserted question in database,but for checking ans i have done some steps but not getting the right way,for ans my code is

			$id = $_GET['id'];

$query = "SELECT * FROM `exam`";
	$result=mysql_query($query) or die(mysql_error());
			echo "correct ans";
			echo "wrong!";
	while($an = mysql_fetch_assoc($result)){
		<form action="" method="post">	
		<tr><input type="radio" name="ansh" value="1"><?=$an['a']?></tr><br>
		<tr><input type="radio" name="ansh" value="2"><?=$an['b']?></tr><br>
		<tr><input type="radio" name="ansh" value="3"><?=$an['c']?></tr><br>
		<tr><input type="radio" name="ansh" value="4"><?=$an['d']?></tr><br>
			<input type="submit" value="submit">
	please help me......................