Page 1 of 1

$result function = having trouble making a table

Posted: Thu Mar 25, 2004 4:15 pm
by warriors2003
trying to make a table from using the $result function, having trouble getting the data to feed in where I need to go. Major props to Mark last night who helped me with the below code. I never used the Result function, and having trouble figuring out how it feeds into a table here is my code


TABLE JUNK IS HERE IS HERE


<?
// Display requested entries
while ( $row = mysql_fetch_array($result))

{
echo "<tr><td bgcolor=CCCCCC>$row[against]</td><td bgcolor=CCCCCC>$row[ab]</td><td bgcolor=CCCCCC>$row[h]</td><tr><td bgcolor=CCCCCC>$row[hr]</td><td bgcolor=CCCCCC>$row[rbi]</td><td bgcolor=CCCCCC>$row[doubles]</td><tr><td bgcolor=CCCCCC>$row[triples]</td><td bgcolor=CCCCCC>$row[r]</td><td bgcolor=CCCCCC>$row[sb]</td></tr>";
}
?>
-----------------------------------------------

I'm guessing there is soemthing wrong in the echo. I am trying to get the data to fill out all on one line, then the next set of data for that ID right udner it,,,it is coming out all messed up like this

http://www.becauseitscool.com/hitplayer.php?hit_id=55

Thanks in advance

Posted: Thu Mar 25, 2004 4:38 pm
by markl999
You just need to remove the extra <tr>'s in there.
So you'de end up with something like,
echo "<tr><td> ... </td><td> ... </td> etc..etc.. </tr>";

Posted: Thu Mar 25, 2004 4:49 pm
by warriors2003
GOOD CATCH MY FRIEND!! YOU DA MAN!!!