The following code is held in an appropriately named .php file.. its include()'d when db access is needed, Connect2DB is then called.. No Problem right? Well...
I receive..
Warning: Undefined variable: dbHost in path_here/dbfile.php on line number
for EVERY variable below.
What silly thing have a done wrong this time?
<?php
$dbName = "pwd";
$dbHost = "localhost";
$dbUsr = "usr";
$dbPwd = "pwd";
function Connect2DB() {
if (ServerOpen($linkdb, $dbHost, $dbUsr, $dbPwd) == false) {
print('ServerOpen failed<br>');
die;
}
elseif (DatabaseOpen($linkdb, $dbName) == false) {
print('DatabaseOpen failed<br>');
die;
}
}
?>