<?php
include("dbinfo.inc.php");
mysql_connect($host,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = "SELECT DISTINCT
requestlist.songID, songlist.ID, requestlist.ID, songlist.artist, songlist.title, songlist.count_requested, songlist.composer, requestlist.status
FROM
radio.requestlist
INNER JOIN radio.songlist ON requestlist.songID = songlist.ID
WHERE
requestlist.status = 'played'
GROUP BY
requestlist.status, songlist.title, songlist.artist
ORDER BY
songlist.count_requested DESC, songlist.artist DESC LIMIT 30;
";
$result=mysql_query($query);
$num=mysql_num_rows($result);
if ($result = mysql_query($query)) {
if (mysql_num_rows($result)) {
echo "<ol>\n";
while ($row = mysql_fetch_assoc($result)) {
echo "<li> {$row['artist']} - <a href='{$row['songID']}'>{$row['title']}</a> ({$row['count_requested']} ) </li>\n";
}
echo "</ol>\n";
} else {
// no results found, handle error.
} else {
// query failed, handle error.
trigger_error(mysql_error());
}
?>
and its a parse error
Parse error: syntax error, unexpected T_ELSE in on line 34
i took out some of the html above it so yeah
// no results found, handle error.
} else {
line 34 is the else