I am getting the following error message....
Fatal error: Uncaught exception 'Exception' with message 'db_connect cound not connect to database: Access denied for user 'omgma_omgmauser'@'localhost' (using password: YES)' in /home/omgma/public_html/Fresh_start/test.php5:25 Stack trace: #0 {main} thrown in /home/omgma/public_html/Fresh_start/test.php5 on line 25
This is when I run the database connection code with a bogus password so it will fail.
Why does it not return the error message that I indicated for it to use?
Here is the code:
@ $db= new mysqli("localhost", "omgma_omgmauser", "XXXX", "omgma_members") or die ('I cannot connect to the database because: ' . mysql_error());
if (mysqli_connect_errno() > 0)
{
throw new Exception("db_connect cound not connect to database:\n".mysqli_connect_error());
}
Or maybe it did return the message but instead of an error number it dumped in all that other stuff.
Is that what I should get on an error?