Modify sript that generates a table
Posted: Thu Feb 17, 2011 12:22 am
Have this script that generates a table with the results of a query.
<?php
$query = "SELECT team_grade, day_played, COUNT(team_grade) FROM Team_entries GROUP BY team_grade ORDER BY day_played" ;
$result = mysql_query($query) or die(mysql_error());
{
$num_rows = mysql_num_rows($result);
print "<table width=600 border=1>\n";
while ($get_info = mysql_fetch_row($result)){
print "<tr>\n";
foreach ($get_info as $field)
print "\t<td>$field</td>\n";
echo "<td>ladder</td>";
print "</tr>\n";
}
print "</table>\n";
}
?>
Have added this line to the script
echo "<td>ladder</td>";
it adds another column to the table, with the text "ladder"in it, that is what I want to do
Problem, how can I create a link from the text "Ladder" to a detail page eg. <a href="detailfile.php?ladder=<?php echo $row_Team_entries['team_grade']; ?">
Do not have a good understanding of php, but I am a tryer !! Any help would be greatly appreciated.
<?php
$query = "SELECT team_grade, day_played, COUNT(team_grade) FROM Team_entries GROUP BY team_grade ORDER BY day_played" ;
$result = mysql_query($query) or die(mysql_error());
{
$num_rows = mysql_num_rows($result);
print "<table width=600 border=1>\n";
while ($get_info = mysql_fetch_row($result)){
print "<tr>\n";
foreach ($get_info as $field)
print "\t<td>$field</td>\n";
echo "<td>ladder</td>";
print "</tr>\n";
}
print "</table>\n";
}
?>
Have added this line to the script
echo "<td>ladder</td>";
it adds another column to the table, with the text "ladder"in it, that is what I want to do
Problem, how can I create a link from the text "Ladder" to a detail page eg. <a href="detailfile.php?ladder=<?php echo $row_Team_entries['team_grade']; ?">
Do not have a good understanding of php, but I am a tryer !! Any help would be greatly appreciated.