this is what i currently i have and the answers are displaying directly but they cannot be selected
thanks in advance
<?php
//connects to the database
$host="localhost"; // Host name
$username="****"; // Mysql username
$password="****"; // Mysql password
$db_name="nigeriag_mytest"; // Database name
$tbl_name="question_list"; // Table name
// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
//$regnum="";
//$fname=$_GET['fname'];
$data = mysql_query("SELECT * FROM $tbl_name WHERE 1 ORDER BY RAND() LIMIT 1;") or die(mysql_error());
print "<table border=0 cellpadding=1>";
while ($info=mysql_fetch_array($data)) {
print "<tr>";
print "<th></th> <td>".$info['question']."</td>";
print"</tr>";
print "<tr>";
print "<th></th> <td>".$info['opt1']."</td>";
print "</tr>";
print "<tr>";
print "<th></th> <td>".$info['opt2']."</td>";
print "</tr>";
print "<tr>";
print "<th></th> <td>".$info['opt3']."</td>";
print "</tr>";
print "<tr>";
print "<th></th> <td>".$info['opt4']."</td>";
print "</tr>";
}
print"</table>";
?>
This post has been edited by Dormilich: 02 November 2011 - 08:09 AM
Reason for edit:: removed login credentials

New Topic/Question
Reply



MultiQuote




|