In de query achter categoryid < ? voor het vraagteken het aantal categorien van sam invullen.
Code: Selecteer alles
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?
require_once('../config/config.php');
require_once('../display/display.header.php');
date_default_timezone_set('Europe/London');
echo "<div id='currently_playing_wrapper'>";
echo "<div id='currently_playing'>";
echo "<table cellpadding='0' cellspacing='0'>";
echo " <thead>";
echo " <tr>";
echo " <font face='Verdana, Arial, Helvetica' size='2' color='#FFFFFF'>";
echo " <th align='left' style=width: 60px;'>";
echo " </th>";
echo " <th align='left' style='width: 170px;'>";
echo " Artist ";
echo " </th>";
echo " <th align='left' style='width: 250px;'>";
echo " Title";
echo " </th>";
echo " <th align='left' style='width: 230px;'>";
echo " Album";
echo " </th>";
echo " <th align='left'>";
echo " Added";
echo " </th>";
echo " </font>";
echo " </tr>";
echo " </thead>";
mysql_connect('localhost', 'naam database', 'wachtwoord database');
mysql_select_db('naam database') or die(mysql_error());
$result = mysql_query("SELECT categorylist.*, songlist.id, songlist.info, songlist.title, songlist.album, songlist.picture, songlist.artist, songlist.date_added FROM categorylist, songlist WHERE categoryid > 0 AND categoryid < 18 AND categorylist.songid=songlist.id AND songlist.songtype='S' ORDER BY songlist.date_added DESC LIMIT 50" );
if (!$result)
{
$message = 'Invalid query: ' . mysql_error() . "\n";
$message .= 'Whole query: ' . $query;
error_log($message);
echo 'An error occurred. Please try again. If the problem persists, <a href="mailto:email-adres">contact support</a>.';
exit;
}
//$result_list = array();
while($row = mysql_fetch_array($result))
//$result_list[] = $row;
{
echo " <tbody>";
echo " <tr>";
//echo " <td colspan='6' id='td-playlist-paging'>";
//echo " </tr>";
//echo " <tr>";
echo " <td>";
echo "<img align=left src='pictures/" . rawurlencode($row["picture"]) ."', width='60' height='60'>";
echo " </td>";
echo " <td>";
echo "<font face=Verdana size=1.5><b><a href='javascript:songinfo(". $row["id"] . ")'>" . $row["artist"] . "</a></i></font><br>";
echo " </td>";
echo " <td>";
echo "<font face=Verdana size=1.5><b> " . $row['title'] . "</font><br/>";
echo " </td>";
echo " <td>";
echo "<font face=Verdana size=1.5><b> " . $row['album'] . "</font><br/>";
echo " </td>";
echo " <td>";
echo "<font face=Verdana size=1.5><b> " . substr($row['date_added'],8,2) . "-" .substr($row["date_added"],5,2)." </font><br/>";
echo " </td>";
//echo " </tr>";
//echo " <tr>";
//echo " <td colspan='6' id='td-playlist-paging'>";
//echo " </tr>";
//echo "endforeach";
mysql_close();
}
echo " </tbody>";
echo "</table>";
echo "</div>";
echo "</div>";
?>
<!-- JQuery to round corners some of the HTML items on the page -->
<script type="text/javascript">
//<![CDATA[
// Make sure the DOM is ready
$(document).ready(function() {
// Rounding of corners (Cross-browser compatible)
// See http://jquery.malsup.com/corner/ for different Styles.
// Rounds the page corners
$('#page').corner();
// Rounds the Navigation Menu Corners
$('#navigation dl').corner();
// Rounds the Currently Playing Table Corners
$('#currently_playing').corner();
// Rounds the Currently Playing Table Corners
$('#currently_playing_wrapper').corner();
// Rounds the Coming Up Corners
$('#coming-up').corner();
// Rounds the Recently Played Table Corners
$('#recently_played').corner();
// Style odd and even rows in Currently Playing Table (Cross-browser compatible)
$('#recently_played table tbody tr:nth-child(odd)').addClass('recently_played_odd');
$('#recently_played table tbody tr:nth-child(even)').addClass('recently_played_even');
// Round the Dedication Corners
$('#dedication dl').corner('tl tr').corner();
// Round the Top Request Corners
$('#top_requests dl').corner();
});
//]]>
</script>
</body>
</html>