Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Database Connection Here
- $stmt1 = "SELECT date FROM fixtures GROUP BY date HAVING COUNT(*) > 1"; // No need to return more than you need.
- $result1 = mysql_query( $stmt1 ) or die('MySQL Qeury Error: ' . mysql_error());
- // Table
- $table = '<table width="525" border="0" cellpadding="40" height="63">' . PHP_EOL;
- while( $row = mysql_fetch_assoc($result)){
- $date = $row['date'];
- $sDate = date("D M j Y", strtotime($row['date']));
- $table .= '<tr>
- <td colspan="8" align="left" class="td">
- <b>' . $date . '</b>
- </td>
- </tr>' . PHP_EOL;
- // Add Table Rows.
- $stmt2 = "SELECT * FROM fixtures WHERE date='{$date}'";
- $result2 = mysql_query($stmt2) or die('MySQL Query Error: ' . mysql_error());
- while( $row2 = mysql_fetch_assoc($result2) ){
- $time = strtotime($row2['time']);
- $first = $row2['firstTeam'];
- $second = $row2['secondTeam'];
- $gameid = $row2['gameId'];
- $real_time = date("H:i", $time);
- $timeMinus1Hour = $time - 3600; // 3600 Seconds is 1 hour.
- if(time() < $timeMinus1Hour){ // If the current time is less than 1 hour before $row['time'];
- $table .= '<tr class="big">
- <td width="56" align="left" style="color: #709b52;">
- <a href="" class="result_hover">results</a>
- </td>
- <td width="182" align="right">
- <a href="forecast.php?first1=' . $first . '&second1=' . $second . '&game_id=' . $gameid . '" id="fixtures">
- ' . $first . '
- </a>
- </td>
- <td width="-31" align="center">
- <a href="forecast.php?first1=' . $first . '&second1=' . $second . '&game_id=' . $gameid . '" id="fixtures">
- vs
- </a>
- </td>
- <td width="-12" align="left">
- <a href="forecast.php?first1=' . $first . '&second1=' . $second . '&game_id=' . $gameid . '" id="fixtures">
- ' . $second . '
- </a>
- </td>
- <td>
- <a href="forecast.php" id="fixtures">
- ' . $real_time . '
- </a>
- </td>
- </tr>' . PHP_EOL;
- }
- }
- }
- $table .= '</table>' . PHP_EOL;
- $table .= '<script type="text/javascript">
- $("#fixtures).click(function (){
- return false;
- });
- </script>' . PHP_EOL;
- echo $table;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement