Hello, all.

I have a working app that runs in PHP 4.4.9 on the server. I develop the app on my local environment, which runs PHP 5.2.6.

The setup is thus:

From my index, I have


config.php looks like this:


$db_host = 'localhost';
$db_user = 'someuser';
$db_password = 'somepassword';



dbstuff.php looks like this:


if( !$dbh ) {
$dbh = mysql_connect($db_host, $db_user, $db_password) or die('Could not connect: ' . mysql_error());



For some reason, the $db_host, $db_user, and so on defined in config.php are not accessible from dbstuff.php on my development environment. I wlll get

[timestamp] [error] [client] PHP Notice: Undefined variable: db_host in somepath\db_stuff.php on line whatever

which causes

'Could not connect: some MySQL error message that is obtained when attempting to login with a nonexistent user'

This works on the production environment (the one with PHP version 4.4.9). register_globals is Off in both environments.

What is going on, here?

A. Wilson

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to