hmm that didn't work :bemused:
here is my code without what the sorting code that you gave me the link to
function cdlist() {
global $dbName, $table;
$dbLink = Connect();
$db_selected = mysql_select_db($dbName, $dbLink);
if (!$db_selected) {
die (mysql_error());
if(!$dbName) error_msg(sql_error());}
$cdQuery = "SELECT count(*) FROM ".$table["iquil"];
$cdResult = mysql_query($cdQuery, $dbLink)
or die(mysql_error());
if(!$cdResult) sql_error();
$cdData = mysql_fetch_row($cdResult);
if(!$cdData[0]) $cdlist = "There are currently no albums listed in the database.";
else {
$cdQuery = "SELECT Artist, Album, Year, Genre FROM ".$table["iquil"]." ORDER BY Artist DESC, Album DESC";
$cdResult = mysql_query($cdQuery, $dbLink)
or die(mysql_error());
if(!$cdResult) error_msg(sql_error());
$cdlist = "<br><b>DJ ".$table["iquil"]."</b><br><table class=\"td\"><tr><td>Artist</td><td>Album</td><td>Genre</td><td>Year Released</td></tr>";
while($cdData = mysql_fetch_array($cdResult)) {
$cdlist .= "<tr><td class=\"td\">$cdData[Artist]</td><td class=\"td\">$cdData[Album]</td><td class=\"td\">$cdData[Genre]</td><td class=\"td\">$cdData[Year]</td></tr>";
}
$cdlist .= "</table>";
}
include "template.php";
}
and this is where i want the sorting thing to go
$cdlist = "<br><b>DJ ".$table["iquil"]."</b><br><table class=\"td\"><tr><td>Artist</td><td>Album</td><td>Genre</td><td>Year Released</td></tr>";
this isn't the entire code tho just the function the sort thing is to be in