Please help me.
I get these two error messages.They are:
Warning: mysqli::mysqli() [function.mysqli-mysqli]: (28000/1045): Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\xxxxx\www\abc\xx\Database.class on line 16
Warning: mysqli::query() [function.mysqli-query]: Couldn't fetch mysqli in C:\xxxxx\www\abc\xx\Database.class on line 32
Database is not available. Try again later
Here is the code :-
<?php
require_once("PasswordPrompter.class"); #@@a10
require_once("Database.class");
require_once("Account.class");
require_once("WebPage.class");
//Testing whether the user has been prompted for a user name
if(!isset($_SERVER['PHP_AUTH_USER'])) #@@a16
{
try
{
$prompter = new PasswordPrompter("secret section");
$prompter->displayPrompt();
}
catch(Exception $e)
{
echo $e->getMessage();
exit();
}
}
// Testing the user name and password entered by the user
else #@@a31
{
try #@@a33
{
$db = new Database("Vars.inc"); #@@a35
$db->useDatabase("UserAccount"); #@@a36
}
catch(Exception $e)
{
echo $e->getMessage();
exit();
} #@@a42
try #@@a43
{
$acct = new
Account($db->getConnection(),"Valid_User"); #@@a46
if(!$acct->selectAccount($_SERVER['PHP_AUTH_USER']))
{
$mess = $acct->getMessage();
echo $mess."<br>";
exit();
} #@@a52
if(!$acct->comparePassword($_SERVER['PHP_AUTH_PW']) )
{
$mess = $acct->getMessage();
echo $mess."<br>";
exit();
} #@@a58
}
catch(Exception $e)
{
echo $e->getMessage();
exit();
}
} #@@a65
$data['user_name'] = $_SERVER['PHP_AUTH_USER']; #@@a66
try #@@a67
{
$welcome_page = new WebPage("Welcome.inc",$data); #@@a69
$welcome_page->displayPage(); #@@a70
}
catch(Exception $e)
{
echo $e->getMessage();
exit();
}
?>
And,when I run this program,I get a login box asking for user name & password.When I supply the user name & password I get the above mentioned error messages !
I have already created a password list file,& created a "useraccount" database with a user & password.
Then why i am getting this error?
I should be getting a welcome page which I am not getting.
And my database.class file has this code in line 16 :-
if(!$this->cxn = new mysqli($host,$user,$passwd))
And,line 32 has this :-
if(!$result = $this->cxn->query("SHOW DATABASES"))
😕
With Regards
Thanks