Forums

This topic is locked

Dynamic Table does not display?

Posted 19 Sep 2005 00:04:42
1
has voted
19 Sep 2005 00:04:42 Nathan Hillman posted:
I am working on my first site and using, PHP, MYSQL & Dreamweaver. I'm creating a dynamic table that displays results using a form variable as input. This works perfectly well until I put the dynamic pages I've created into my web page layout (that uses page frames). I want to keep the consistent look of the site and therefore wanted to have the output of the dynamic information in the mainframe.

As I say, when I don't use the frame layout the code works perfectly, the results are as I want. The PROBLEM is that when I put this in a frame layout when I click my submit button instead of seeing a table, I see the following:

--------------------------------------------------------------------------------------------------
<?php require_once('Connections/SCL_Connection.php'); ?>
<?php
$VarWeek_LeagueTable = "1";
if (isset($_POST['WeekSelect'])) {
$VarWeek_LeagueTable = (get_magic_quotes_gpc()) ? $_POST['WeekSelect'] : addslashes($_POST['WeekSelect']);
}
mysql_select_db($database_SCL_Connection, $SCL_Connection);
$query_LeagueTable = sprintf("SELECT t.TeamName, t.managername, Sum(s.points) AS TotalPoints FROM nh_scores AS s, nh_team as t WHERE t.teamid=s.teamid AND s.weekid between 1 AND %s GROUP BY t.TeamName ORDER BY Totalpoints DESC", $VarWeek_LeagueTable);
$LeagueTable = mysql_query($query_LeagueTable, $SCL_Connection) or die(mysql_error());
$row_LeagueTable = mysql_fetch_assoc($LeagueTable);
$totalRows_LeagueTable = mysql_num_rows($LeagueTable);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<table border="1">
<tr>
<td>TeamName</td>
<td>managername</td>
<td>TotalPoints</td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_LeagueTable['TeamName']; ?></td>
<td><?php echo $row_LeagueTable['managername']; ?></td>
<td><?php echo $row_LeagueTable['TotalPoints']; ?></td>
</tr>
<?php } while ($row_LeagueTable = mysql_fetch_assoc($LeagueTable)); ?>
</table>
</body>
</html>
<?php
mysql_free_result($LeagueTable);
?>
--------------------------------------------------------------------------------------

I would expect to see a dynamic league table not this code???

Does anyone have any ideas?

Thanks in advance.

Nathan
--------------------
PHP, MYSQL, DWMX

Reply to this topic