Using this code on an SQL 4.0 database and it works fine, but doesn't seem to return results when used on an SQL 5 database. Can anyone tell me why? I'm at a loss.
$get_matches = mysql_query("SELECT
DATE_FORMAT(M.MatchDateTime, '%b %D %Y') AS date,
O.OpponentShort AS opponent,
M.MatchID AS id,
MT.MatchTypeName AS typename,
M.MatchStadium AS stadium,
MP.MatchPlaceName AS matchplace,
M.MatchPublish AS publish,
M.MatchReferee AS referee,
M.MatchAttendance AS att,
M.MatchNeutral AS neutral
FROM tplss_matches M, tplss_matchtypes MT, tplss_matchplaces MP, tplss_opponents O
WHERE M.MatchSeasonID = '$seasonid' AND
M.MatchTypeID = MT.MatchTypeID AND
M.MatchPlaceID = MP.MatchPlaceID AND
M.MatchOpponent = O.OpponentID
ORDER BY M.MatchTypeID",$connection)
or die(mysql_error());
if(mysql_num_rows($get_matches) <1)
{
echo "<b>No matches: $seasonname</b>";
}
else
{
echo "<b>Matches in $seasonname:</b><br><br>";
while($data = mysql_fetch_array($get_matches))
{
echo "($data[id]) <a href=\"$PHP_SELF?sessioid=$sessio&action=modify&matchid=$data[id]\">$data[date], vs. $data[opponent]</a> $data[matchplace]";
if($data['neutral'] == 1)
echo'(neutral)';
echo": $data[typename]";
if($data['publish'] == 1)
echo"<br>\n";
else
echo" (NB)<br>\n";
}
}
I don't get an error or anything, it just doesn't return any results.