Hello all, as you probably can tell I'm a beginner in the whole web building arena. But anyways, I have built a page that displays the data located in a Mysql table and then displays that in an HTML table. Now I'm trying to get real dangerous and use that data to create a submission form. I would like to have a radio button for each row of the table using the same name for the buttons so that the user can only select one game from the list. I have tried echoing the table into the code but I get errors when loading the page on the lines that I tried to echo. Please see below for the file and thanks in advance for any help.
<html><head><title>Game Picker</title></head><body>
<?php
// includes file with db connection info
include 'includes/dbopen.php';
$result = mysql_query("SELECT * FROM week6");
if (!$result) {
die("Query to show fields from table failed");
}
$fields_num = mysql_num_fields($result);
echo "<h1> WEEK 6 {$week6}</h1>";
echo "<table border='1'><tr>";
// printing table headers
for($i=0; $i<$firlds_num; $i++)
{
$field = mysql_fetch_field($result);
echo "<td>{$field->name}</td>";
}
echo "</tr>\n";
// printing table rows
while ($row = mysql_fetch_row($result))
{
echo "<tr>";
// $row is array... foreach( .. ) puts every element
// of $row to $cell variable
foreach($row as $cell)
echo "<td>$cell</td>";
echo "</tr>\n";
}
mysql_free_result($result);
?>
</body></html>