Here's what i've got so far which creates an html table with the right number of rows/columns etc and pulls in the names correctly BUT I'm stuck creating the input area under the scores column.
Code: Select all
<form>
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("lakeside", $con);
$result = mysql_query("SELECT * FROM student_details WHERE year_id=7");
echo "<table border='1'>
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>score</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['first_name'] . "</td>";
echo "<td>" . $row['surname'] . "</td>";
echo "<td>" . $row['<input type="text" name="scores" />'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysql_close($con);
?>
</form>I'm sure the issue is with the line where I try to add in the input area to the html table using: echo "<td>" . $row['<input type="text" name="scores" />'] . "</td>"; biut have no idea how to achieve this.
Any thoughts that might help an enthusiastic newbie would be gratefully received!