oops :bemused:
sorry i only took out the function not the entire code
this is the entire code
<?php
$dbHost = "localhost";
$dbUname = "root";
$dbPass = "root";
$dbName = "cds";
$table["iquil"] = "iquil";
$MYSQL_ERRNO = "";
$MYSQL_ERROR = "";
function cdlist() {
global $dbName, $table;
$dbLink = Connect($dbName);
if(!$dbName) error_msg(sql_error());
$cdQuery = "SELECT count(*) FROM ".$table;
$cdResult = mysql_query($cdQuery);
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 FROM ".$table["iquil"];
$cdResult = mysql_query($cdQuery);
if(!$cdResult) error_msg(sql_error());
$cdlist = "<table class=\"td\"><tr><td>Artist</td><td>Album</td></tr>";
while($cdData = mysql_fetch_array($cdResult)) {
$cdlist .= "<tr><td class=\"td\">$cdData[Artist]</td><td class=\"td\">$cdData[Album]</td></tr>";
}
$cdlist .= "</table>";
}
include "template.php";
}
function error_msg() {
}
function Connect() {
global $dbHost, $dbUname, $dbPass, $dbName;
global $MYSQL_ERRNO, $MYSQL_ERROR;
$link_id = mysql_connect($dbHost, $dbUname, $dbPass);
if(!$link_id) {
$MYSQL_ERRNO = 0;
$MYSQL_ERROR = "The connection has failed";
return 0;
}
elseif(empty($dbName) && !mysql_select_db($dbName)) {
$MYSQL_ERRNO = mysql_errno;
$MYSQL_ERROR = mysql_error;
return 0;
}
else return $link_id;
}
function sql_error() {
global $MYSQL_ERRNO, $MYSQL_ERROR;
if(empty($MYSQL_error)) {
$MYSQL_ERRNO = mysql_errno;
$MYSQL_ERROR = mysql_error;
}
return "<br>$MYSQL_ERRNO<br>$MYSQL_ERROR<br><br>";
}
cdlist();
?>
i put in the code you gave me and i now get this