⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 listquestion_by_subject.php

📁 一个基于PHP的在线考试系统
💻 PHP
字号:
<html>
<head>
<title>questions</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<?PHP
include('config.inc');

//debug
//$subjectid=0;


//debugends
$db_connect = mysql_connect($datahost,$datauser,$datapasswd);
$base_selection = mysql_select_db($base,$db_connect);
$query =  "SELECT * FROM questionbank where subjectid='".$subjectid."'";
$req = mysql_query($query);
//$res = mysql_num_rows($req);




 while($row = mysql_fetch_array($req)){
$questionid=$row['questionid'];
$question=$row['question'];
$choice1=$row['choice1'];
$choice2=$row['choice2'];
$choice3=$row['choice3'];
$choice4=$row['choice4'];
$answer=$row['answer'];
echo "<table width=\"90%\" border=\"1\" cellspacing=\"1\" cellpadding=\"1\">\n";
echo "<tr><td width=\"10%\"><b> ".$questionid." </b></td><td colspan=4>".$question."</td></tr>\n";     
echo "<tr><td width=\"10%\"><b> answer:".$answer." </b></td><td width=\"20%\">".$choice1."</td></td><td width=\"20%\">".$choice2."</td><td width=\"20%\">".$choice3."</td><td width=\"20%\">".$choice4."</td></tr>\n";
echo "</table>\n";
echo "<br>\n";
;
}

mysql_free_result($req);
 
?>

</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -