rhemler Posted March 26, 2006 Share Posted March 26, 2006 Here is the source page minus the database login settingsand 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> Quote Link to comment Share on other sites More sharing options...
redarrow Posted March 26, 2006 Share Posted March 26, 2006 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] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.