I have a jquery rotating scoreboard on my site that displays the previous 3 games played from the database what i am trying to do is make the scoreboard show the games for the current date.
If the game on the current date hasnt been played it will show a gameday link from the gameday.php file and if it has been played show the scores and the boxscore link (showgame.php)
and if no gameson the specified date show 'No games Scheduled'
here is the current code minus the jquery stuff
$scoreboard =0;
while ($scoreboard < 3) {
$scoreboard1 .= "
<div id=\"content".$scoreboard."\" >";
$col2w=90;
$gamequery=mysql_query("select * from schedule_scores where (team1_score !='') AND league = 1 order by id desc limit $scoreboard,1");
$scoreboard1 .= "<table width=\"175\">";
while ($game=mysql_fetch_array($gamequery))
{
$team1=mysql_fetch_array(mysql_query("select * from teams where (id='$game[team1]')"));
$team2=mysql_fetch_array(mysql_query("select * from teams where (id='$game[team2]')"));
$scoreboard1 .= "
<tr class=\"table_text\"><td width=\"40\"><a title=".$team1["city"]." href=\"./team/?id=".$team1["id"]."\" target=\"_top\"><img border=\"0\" width=\"35\" height=\"35\" src=http://theufhl.com/images/$game[team1pic]></a></td><td width=".$col2w." align=left>".$team1["city"]."</td><td>".$game["team1_score"]."</td></tr>
<tr class=\"table_text\"><td width=\"40\"><a title=".$team2["city"]." href=\"./team/?id=".$team2["id"]."\" target=\"_top\"><img border=\"0\" width=\"35\" height=\"35\" src=http://theufhl.com/images/".$game["team2pic"]."></a></td><td width=".$col2w." align=left>".$team2["city"]."</td><td>".$game["team2_score"]."</td></tr>
";
}
$scoreboard1 .= "
</table>
</div>";
$scoreboard++;
}
for the date i was going to use this
$today = date("Y-m-d", mktime(date("H")-2, date("i"), 0, date("m") , date("d"), date("Y")));
$gamequery=mysql_query("select * from schedule_scores where (team1_score !='') AND league = 1 AND date = '".$today." order by id desc limit $scoreboard,1");
I had the No games scheduled part in, but with it in it didnt show any games at all. just no games scheduled.
any pointers on how i can get something stated is appriciated.
thanks