John_Saunders
01-11-2003, 03:18 AM
I came across a cool script at http://martin.f2o.org/download/sitemap/ for creating a navigation bar and sitemap. I uploaded it to my server and installed the DB and PEAR files from the PEAR website and I keep getting the error below when trying to calll www.domain.com/global.php.
Fatal error: Call to undefined function: connect_db() in /home/website/public_html/global.php on line 36
I don't understand why it isn't connecting and I don't see any place in the script that includes the config.php file. I tried copying and pasting the entire config.php script into the globabl.php but it still didn't work. I know my settings are all correct for the database connection and the path to the DB.php is correct:
function &db_connect() {
require_once '/home/website/public_html/php/pear/DB.php';
$db_host = 'localhost';
$db_user = 'template';
$db_pass = 'test1234';
$db_name = 'template';
$dsn = "mysql://$db_user:$db_pass@$db_host/$db_name";
$db = DB::connect($dsn);
if (DB::isError($db)) {
die ($db->getMessage());
}
$db->setFetchMode(DB_FETCHMODE_OBJECT);
return $db;
}
Can somebody tell me why it isn't working? They didn't have an example of how to call a page or anything in the sitemap.zip download.
John
Fatal error: Call to undefined function: connect_db() in /home/website/public_html/global.php on line 36
I don't understand why it isn't connecting and I don't see any place in the script that includes the config.php file. I tried copying and pasting the entire config.php script into the globabl.php but it still didn't work. I know my settings are all correct for the database connection and the path to the DB.php is correct:
function &db_connect() {
require_once '/home/website/public_html/php/pear/DB.php';
$db_host = 'localhost';
$db_user = 'template';
$db_pass = 'test1234';
$db_name = 'template';
$dsn = "mysql://$db_user:$db_pass@$db_host/$db_name";
$db = DB::connect($dsn);
if (DB::isError($db)) {
die ($db->getMessage());
}
$db->setFetchMode(DB_FETCHMODE_OBJECT);
return $db;
}
Can somebody tell me why it isn't working? They didn't have an example of how to call a page or anything in the sitemap.zip download.
John