<?php
$query = "Select * from users where username = '$user' ";
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_array($result);
$test = $_POST['test1'];
$ques = "Select * from questions where testname = '$test' ";
$qres = mysql_query($ques) or die(mysql_error());
$qdetails = mysql_fetch_array($qres);
$id = $qdetails['id'];
$testname = $qdetails['testname'];
$ans = "Select * from answers where qid = $id";
$ares = mysql_query($ans) or die(mysql_error());
if($qdetails) {
?>
<div class="padding">
<form name="answerform" action="answer.php" method="GET">
<h3> </h3>
<input name="test2" id="test2" type="text" value="<?php echo $qdetails['testname'];?>" /><h3><?php echo $qdetails['text'];?></h3>
<input name="test3" id="test3" type="text" value="<?php echo $qdetails['testseries'];?>" /><h3><?php echo $qdetails['text'];?></h3>
<br />
<br />
<br />
<?php while($opdetails = mysql_fetch_assoc($ares)) { ?>
<input class="text" id="opt2" name="correctans" type="radio" value="<?php echo $opdetails['text']; ?>" /><br /><?php echo $opdetails['text']; ?> <?php }?>
<div class="two-fields clearfix".
<p class="confirm"> </p>
</div>
<input type="submit" value="SUBMIT ANSWER" />
</form>
</div>
</div>
</div>
THIS IS answer.php在這裏,我嘗試從TEST2 TEST3和發佈領域的信息,但我沒有得到任何輸出 輸出顯示空數組() 和身份不明的指數TEST2 和不明指數TEST3 我無法找出錯誤
嘿,我真的很抱歉...我發佈了相同的代碼2wice ..我糾正了它... plz再次查看,並提供一些幫助...我真的appericiate你的努力......感謝您的幫助 – 2012-01-11 17:14:17