I have a code that works but I want to liit it to only show the row of the current user viewing the page. Can someone show me where I can make the change? Right now it spits out the results for all users, I just want it for the current user viewing the page.
Code: Select all
<?php //Display picks for this user, highlight any correct ones.
$total=$football->NumberOfGames($week);
// Get current date and time to determain if a game has started or not
$date = date("m/d/Y");
$time = date("H:i:s A");
$datetime = $football->doDate($date,$time,$football->display_offset);
$sql1="select * from ".$football->prefix."picks, ".$football->prefix."schedule where user = '".$username."' and week = ".$week." and ".$football->prefix."picks.gameid = ".$football->prefix."schedule.gameid order by ".$football->prefix."schedule.gametime, ".$football->prefix."schedule.gameid";
$rs1 = $football->dbQuery($sql1);
$rows = mysql_num_rows($rs1);
if($rows > 0)
{
while($row1=mysql_fetch_object($rs1))
{
$pick=$row1->pick;
$icon=$iconfile[$pick];
$result=$row1->result;
$sresults=$row1->sresults;
$style = "\"border: .2em solid $color;\"";
if($pick=="")
{
$pick="---";
}
// check if system usisng spread
$bcolor = "#006600"; // set win border color
if ($football->usespread == "Y") {
if ($pick != $result and $pick == $sresults) { $bcolor ="#006600"; }
$result=$sresults;
}
if ($pick==$result)
{
// $pick="<strong>".$pick."</strong>";
// Hack to see winner better from Mrtalk
$pick="<font color='#0b7b0b' size=1pt><strong><B>".$pick."</B></strong></font>";
// $style = "\"border: .2em solid $bcolor;\"";
}
if ($result=="TIE")
{
// $pick="<strong>".$pick."</strong>";
// Hack to see winner better from Mrtalk
$pick="<font color='#ff0000' size=1pt><strong><B>".$pick."</B></strong></font>";
// $style = "\"border: .2em solid $bcolor;\"";
}
if ($member != $football->admin_username)
{
// $alllocked = $football->ckAlllocked($week);
// if ($alllocked != true)
if ($row1->gametime >= $datetime and $football->showPicks == "Y" and $member != $username) // has game already started
{
$pick="---";
}
}
if ($pick=="---") {
?>
<td><?php echo $pick; ?></td>
<?php }
else {
?> <td>
<? if ($football->display_graphics == "Y" and $result!="TIE") { ?>
<image src = "images/<? echo $icon; ?>" width="20" style="<? echo $style; ?>" ?> width=20 style=<? echo $style; ?>><br>
<? } ?>
<? if ($football->display_graphics == "Y" and $result=="TIE") { ?>
<image src = "images/<? echo $icon; ?>" width="20" style="<? echo $style1; ?>" ?> width=20 style=<? echo $style1; ?>><br>
<? } ?>
<? echo $pick; ?></td><?
}
}
Patsman77