Okay, Very Newbie-ish question coming!

I can't figure out why my include won't work... Here's the text:

index.php:
<?PHP

include 'defaults.php';

$link = mysql_connect($server, $username, $password) or die('Could not connect: ' . mysql_error());
echo 'Connected successfully <BR>';
mysql_select_db($database) or die('Could not select database: ' . mysql_error());
echo 'DB selected <BR>';

$result = mysql_query($query) or die(mysql_error());
$num=mysql_numrows($result);
$i= 0;


while($i < $num) {
        
        $FName = mysql_result($result, $i,"FName");
        $LName = mysql_result($result,$i,"LName");
        $Add1 = mysql_result($result, $i,"Add1");
        $Add2 = mysql_result($result, $i,"Add2");
        $City = mysql_result($result, $i,"City");
        $State = mysql_result($result, $i,"State");
        $Zip = mysql_result($result, $i,"Zip");
        $Date = date("m-d-y h:i:s",mysql_result($result, $i, "Date"));
        $Record = mysql_result($result, $i, "Record");
        $subName = mysql_result($result, $i,"subName");
        $subEmail = mysql_result($result, $i,"subEmail");
        $subPhone = mysql_result($result, $i,"subPhone");
        $chkMember = unserialize(mysql_result($result, $i,"chkMember"));
        $chkAdd = unserialize(mysql_result($result, $i,"chkAdd"));
        $chkDel = unserialize(mysql_result($result, $i, "chkDel"));
        
        $i++;

//echo "<P>$Record $FName, $LName,</P> <P>$Add1,<BR> $Add2,<BR></P> <P>$City, $State, $Zip,</P> $Date,<BR> $subName, $subEmail, $subPhone, $chkMember[$row], $chkAdd[$row], $chkDel[$row]<BR>";
        
        echo "<H3>Name Address</H3>";
        echo "<P id ='test'> $FName $LName $Add1 $Add2 $Date</P>";

};




?>
*
defaults.php:

$server = 'localhost';
$username = 'USERNAME';
$password = 'PASSWORD';
$database = 'DATABASE';
$query = 'SELECT * FROM current';

Yes I changed the values of username, password, and database. But when I use the same info inside the index.php file it all works just fine. Here is the error that it gives me:

[Fri May 18 15:32:07 2007] [error] PHP Notice: Undefined variable: server in /Volumes/RAIDer/webserver/Documents/tests/legion/index.php on line 5 [Fri May 18 15:32:07 2007] [error] PHP Notice: Undefined variable: username in /Volumes/RAIDer/webserver/Documents/tests/legion/ index.php on line 5 [Fri May 18 15:32:07 2007] [error] PHP Notice: Undefined variable: password in /Volumes/RAIDer/webserver/Documents/tests/legion/ index.php on line 5 [Fri May 18 15:32:07 2007] [error] PHP Warning: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Access denied for user 'USERNAME'@'localhost' (using password: NO) in / Volumes/RAIDer/webserver/Documents/tests/legion/index.php on line 5


Thanks in advance for helping me through my obvious friday afternoon brain fart...




--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424
www.raoset.com
[EMAIL PROTECTED]


Reply via email to