Jump to content


Photo

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


  • Please log in to reply
1 reply to this topic

#1 rhemler

rhemler
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 26 March 2006 - 09:37 PM

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>

#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 26 March 2006 - 10:15 PM

Look at your while loop agin ok.


if you can see team id now wonder why ,

while loop

<?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];
}
?>

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users