Hey,
I want to show all the records in my database on one page, in a table. I've managed to get all the records to show, but i cant seem to put it into a table properly. when i try, it either doesn't work or just shows the latest record.
heres the code so far;
$query = 'SELECT * FROM response';
$result = mysql_query($query) or die ('query failed: ' . mysql_error());
while ($line=mysql_fetch_array($result))
{
$faculty=$line ['faculty'];
$moduleCode=$line['moduleCode'];
$moduleTitle=$line['moduleTitle'];
$school=$line['school'];
$date=$line['date'];
$q1=$line ['q1'];
$q2=$line['q2'];
$q3=$line['q3'];
$q4=$line ['q4'];
$q5=$line ['q5'];
$q6=$line ['q6'];
$q6=$line ['q6'];
$q7=$line ['q7'];
$q8=$line ['q8'];
$q9=$line ['q9'];
$q10=$line ['q10'];
$q11=$line ['q11'];
$q12=$line['q12'];
$q13=$line ['q13'];
$q14=$line ['q14'];
$q15=$line ['q15'];
$q16=$line ['q16'];
$q17=$line ['q17'];
$features=$line ['features'];
$comments=$line['comments'];
print "<tr><th>$faculty;</th></tr>";
print "<tr><th>$moduleCode;</th></tr>";
print "<tr><th>$moduleTitle;</th></tr>";
print "<tr><th>$school;</th></tr>";
print "<tr><th>$date;</th></tr>";
print "<tr><th>$q1;</th></tr>";
print "<tr><th>$q2;</th></tr>";
}
I want to show all the records in my database on one page, in a table. I've managed to get all the records to show, but i cant seem to put it into a table properly. when i try, it either doesn't work or just shows the latest record.
heres the code so far;
$query = 'SELECT * FROM response';
$result = mysql_query($query) or die ('query failed: ' . mysql_error());
while ($line=mysql_fetch_array($result))
{
$faculty=$line ['faculty'];
$moduleCode=$line['moduleCode'];
$moduleTitle=$line['moduleTitle'];
$school=$line['school'];
$date=$line['date'];
$q1=$line ['q1'];
$q2=$line['q2'];
$q3=$line['q3'];
$q4=$line ['q4'];
$q5=$line ['q5'];
$q6=$line ['q6'];
$q6=$line ['q6'];
$q7=$line ['q7'];
$q8=$line ['q8'];
$q9=$line ['q9'];
$q10=$line ['q10'];
$q11=$line ['q11'];
$q12=$line['q12'];
$q13=$line ['q13'];
$q14=$line ['q14'];
$q15=$line ['q15'];
$q16=$line ['q16'];
$q17=$line ['q17'];
$features=$line ['features'];
$comments=$line['comments'];
print "<tr><th>$faculty;</th></tr>";
print "<tr><th>$moduleCode;</th></tr>";
print "<tr><th>$moduleTitle;</th></tr>";
print "<tr><th>$school;</th></tr>";
print "<tr><th>$date;</th></tr>";
print "<tr><th>$q1;</th></tr>";
print "<tr><th>$q2;</th></tr>";
}