CODE
require 'config.php';
// Connect to Mysql
$db = mysql_connect($dbhost, $dbusername, $dbpassword)
or die('Could not connect: ' . mysql_error());
//Select the correct database.
mysql_select_db($dbname,$connect)
or die ("Could not select database");
print "<ul>";
$top_menu = $db->getALL('SELECT * FROM top_menu');
foreach ( $top_menu as $links )
{
print "<li><a href=\"";
echo $links['url'];
print "\"><span>";
echo $links['name'];
print "</span></a></li>";
}
print "</ul>";
This is what I now have. I am now connecting correctly. I am now getting an error on line 45 which is:
CODE
$top_menu = $db->getALL('SELECT * FROM top_menu');
I can't find what is wrong with it. This is the error:
Fatal error: Call to a member function on a non-object in /homepages/16/d168863731/htdocs/source/functions.php on line 45
Thanks for all the help.