Problems with detailed linkpage
Posted: Wed Mar 24, 2004 7:24 pm
Ok,,I have an overall Baseball Stats table. I want it so when you click on the player, it will then take you to the game by game breakdown page for that player listing all his games.
Overall Stats are located in a table "hit"
I have hit_id as auto, prim, unique
The individual game stats are in "hitg"
it has hitid, no auto, no prim, no unique, and feeds quite well from the hit_id i have from the submit form.
The form I have works, everythign goes into the two tables nicely. One adds them up "hit", the other keeps them all seperate "hitg".
Here is the problem,,,In the overall stats table i'm using this as the link in the code to take you to the hitplayer breakdown page
echo "<a href=hitplayer.php?hit_id=$row[hit_id]>";
Now the problem I';m having is making that hitplayer.php page. I've been looking around, try different codes, but can;t get one to work. I don;t know if its becuase I have soemthign screwy in the field name in the table or hit id's are conflicting.
Here is what i picked up from doing some reasearch
CODE--------------------------
<?
mysql_query("select * from hitg where hitid = '$hit_id'");
?>
<tr>
<td align=center valign=top><B>AB</B></td>
<td align=center valign=top><B>hits</B></td>
<td align=center valign=top><B>hr</B></td>
</tr>
<?
// Display requested entries
while ( $row = mysql_fetch_array($result) ) {
echo("<tr>
<td align=center valign=top>
". $row["ab"] . "</td>
<td align=center valign=top>
" . $row["h"] . "</td>
<td align=center valign=top>
" . $row["hr"] . "</td></tr>");
}
?>
____________________ End Code
I know their maybe something screwy with the id and how i have it setup in the query, or maybe its in the linkage to i dunno.
Its just a matter of querying just the ID's games in the breakdown on hitg and displaying them right from the link that is throwing me off.
THANKS SO MUCH IN ADVANCE!!
Overall Stats are located in a table "hit"
I have hit_id as auto, prim, unique
The individual game stats are in "hitg"
it has hitid, no auto, no prim, no unique, and feeds quite well from the hit_id i have from the submit form.
The form I have works, everythign goes into the two tables nicely. One adds them up "hit", the other keeps them all seperate "hitg".
Here is the problem,,,In the overall stats table i'm using this as the link in the code to take you to the hitplayer breakdown page
echo "<a href=hitplayer.php?hit_id=$row[hit_id]>";
Now the problem I';m having is making that hitplayer.php page. I've been looking around, try different codes, but can;t get one to work. I don;t know if its becuase I have soemthign screwy in the field name in the table or hit id's are conflicting.
Here is what i picked up from doing some reasearch
CODE--------------------------
<?
mysql_query("select * from hitg where hitid = '$hit_id'");
?>
<tr>
<td align=center valign=top><B>AB</B></td>
<td align=center valign=top><B>hits</B></td>
<td align=center valign=top><B>hr</B></td>
</tr>
<?
// Display requested entries
while ( $row = mysql_fetch_array($result) ) {
echo("<tr>
<td align=center valign=top>
". $row["ab"] . "</td>
<td align=center valign=top>
" . $row["h"] . "</td>
<td align=center valign=top>
" . $row["hr"] . "</td></tr>");
}
?>
____________________ End Code
I know their maybe something screwy with the id and how i have it setup in the query, or maybe its in the linkage to i dunno.
Its just a matter of querying just the ID's games in the breakdown on hitg and displaying them right from the link that is throwing me off.
THANKS SO MUCH IN ADVANCE!!