A
Anonymous
Guest
Trying to update an old website from MySQL to MySQLi. Connection to database is fine but the site won't display any information from the database. Probably a typo somewhere but my weary eyes aren't seeing it. Can anyone check the coding for mistakes? Thanks.
www.beat-the-spread.net
www.beat-the-spread.net
Code:
<?php include("opendatabase.php"); ?>
<?php
for ($i = 1; $i <= 8; $i++)
{
echo "<div class='gameholder'><div class ='textholder2'>";
$result = mysqli_query($con, "
SELECT *
FROM schedule
JOIN teams ON schedule.team = teams.team_id
WHERE week_id ='10'
AND game_id ='$i'");
echo "<table class='schedule'>\n";
while($row = mysqli_fetch_array( $result ))
{
if($row['pt_spread'] == 0)
{
$row['pt_spread'] = "";
}
if(empty($row['pt_spread'] ))
{
$row['pt_spread'] = "";
}
if (empty($row['bye']))
{
echo "</td><td class='schedule' width='51%'>"; echo $row['alt_name'];
echo "</td><td class='schedule' width='25%' style='color:#ffffff;'>"; echo $row['pt_spread'];
echo "</td><td class='schedule' width='16%'>"; echo $row['team_pts'];
echo "</td></tr>";
}
}
echo "</table>";
echo "<br />";
echo "</div> </div>";
}
mysqli_close($con);
?>