Jump to content

Archived

This topic is now archived and is closed to further replies.

rhemler

having a problem seeing the data i am trying to pull out of the database

Recommended Posts

Here is the source page minus the database login settings
and here is the live page as it is now
[a href=\"http://www.unitedbaseball.org/FAN.php\" target=\"_blank\"]PHP Page[/a]


<html>
<head> <title> FAN Interst</title></head>
<body>

<?php

$user="";
$host="localhost";
$password="";
$database = "";
$connection = mysql_connect($host,$user,$password)
or die ("couldn't connect to server");
$db = mysql_select_db($database,$connection)
or die ("Couldn't select database");



$query = "SELECT th.TEAM_ID, th.CHANGE_DATE, th.CHANGE_TYPE, th.OLD_VALUE, th.NEW_VALUE, t.CITY, t.NAME as teamname FROM bosi_TEAM_HISTORY th, bosi_TEAM t WHERE t.TEAM_ID = th.TEAM_ID ORDER BY TEAM_ID";

$results = mysql_query ($query) ;
?>




<table width='75%' border='0' align='center'>
<tr><td width='5%' bgcolor='#B7B78B' align='center'><b><font size='2'>Team</font></b></td>
<td width='15%' bgcolor='#B7B78B' align='center'><b><font size='2'>Old Value</font></b></td>
<td width='15%' bgcolor='#B7B78B' align='center'><b><font size='2'>New Value</font></b></td>
<td width='15%' bgcolor='#B7B78B' align='center'><b><font size='2'>Change</font></b></td>
</tr>


<?
while ( $row = mysql_fetch_array($results))
{

if($row[OLD_VALUE] < $row[NEW_VALUE])
{
$talentmod= "greenarrow.gif";
}
else
{
$talentmod= "redarrow.gif";
}
}
?>



<tr>
<td width='50%' align='center' bgcolor='#D8D8C4'><font size='2'><a target="BLANK" href="/ootp/team<? echo $row[TEAM_ID]; ?>.html"><? echo $row[teamname]; ?></font></td>
<td width='15%' align='center' bgcolor='#D8D8C4'><font size='2'><? echo $row[OLD_VALUE]; ?></font></td>
<td width='15%' align='center' bgcolor='#D8D8C4'><font size='2'><? echo $row[NEW_VALUE]; ?></font></td>
<td width='20%' align='center' bgcolor='#D8D8C4'><font size='2'><img src="devreports/images/<? echo $talentmod; ?>"</img></font></td>

</tr>
</table>

</tr>
</table>

Share this post


Link to post
Share on other sites
Look at your while loop agin ok.


if you can see team id now wonder why ,

while loop

[code]
<?php

$user="";
$host="localhost";
$password="";
$database = "";
$connection = mysql_connect($host,$user,$password)
or die ("couldn't connect to server");
$db = mysql_select_db($database,$connection)
or die ("Couldn't select database");



$query = "SELECT th.TEAM_ID, th.CHANGE_DATE, th.CHANGE_TYPE, th.OLD_VALUE, th.NEW_VALUE, t.CITY, t.NAME as teamname FROM bosi_TEAM_HISTORY th, bosi_TEAM t WHERE t.TEAM_ID = th.TEAM_ID ORDER BY TEAM_ID";

$results = mysql_query ($query);


while ( $row = mysql_fetch_array($results))
{

if($row[OLD_VALUE] < $row[NEW_VALUE])
{
$talentmod= "greenarrow.gif";
}
else
{
$talentmod= "redarrow.gif";
}

echo $row[TEAM_ID];
}
?>
[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.