So sorry Fenway.
This is the error
while ($row = mysql_fetch_array($query)) {
$catlinks .= ' <img src="bullet.gif" width="7" height="7" border="0" align="center"><a href="viewcategory.php?cid='.$row['wallpaperid'].'">'.$row['categoryid'].'</A><br/>';
}
-----
This is the rest of the code within my dbconnect file - minus rows for usernames and passwords.
// Connect to the database.
$database_connection = mysql_connect(DB_HOST, DB_USERNAME, DB_PASS);
mysql_select_db(DB_NAME);
require('class.pagedresults.php');
// Create the navbar.
// Select what we want.
$sql = 'SELECT * FROM `categories`';
$query = mysql_query($sql);
$catlinks = ' <img src="bullet.gif" width="7" height="7" border="0" align="center"><a HREF="http://www.freepspwallpaper.co.uk">Home</A><br/>';
while ($row = mysql_fetch_array($query)) {
$catlinks .= ' <img src="bullet.gif" width="7" height="7" border="0" align="center"><a href="viewcategory.php?cid='.$row['wallpaperid'].'">'.$row['categoryid'].'</A><br/>';
}
$template = file_get_contents('template.php');
$template = str_replace('{LINKS}',$catlinks,$template);
?>