0

First my class:

    class database extends mysqli {
    public function __construct($dbInfo) {
            parent::__construct($dbInfo['host'], $dbInfo['user'], $dbInfo['pass'], $dbInfo['dbname']);

            if (mysqli_connect_error()) {
                die('Connect Error (' . mysqli_connect_errno() . ') '
                        . mysqli_connect_error());
            }
            $this->set_charset("utf8");
        }
    }

        $dbInfo = array(
            'host'      => "localhost",
            'user'      => "user",
            'pass'      => "pass",
            'dbname'    => "name"
        );



$db = new database($dbInfo);

Here I will get this errormessage:

<br />
<b>Warning</b>:  mysqli::mysqli(): (HY000/1044): Access denied for user 'user'@'%' to database 'name' in <b>/www/test/ajax_artikellist.php</b> on line <b>16</b><br />
Connect Error (1044) Access denied for user 'user'@'%' to database 'name'

I would like to have only this as error:

Connect Error (1044) Access denied for user 'user'@'%' to database 'name'

What I have to do to get it?

hamburger
  • 1,339
  • 4
  • 20
  • 41

0 Answers0