PHP-MySQLi-Database-Class icon indicating copy to clipboard operation
PHP-MySQLi-Database-Class copied to clipboard

GetLast error not returning the errors

Open Harsheenajunejo opened this issue 5 years ago • 1 comments

Error function is not working // Define database connection $db = new MysqliDb($db_host,$db_user,$db_pss,$db_name);

// Check if any error occur while establishing database connection. If yes, stop further processing.
if ($db->getLastErrno() != 0) {
	die("ERROR : -> ".$db->getLastError());
}

I have made $db_pass field as $db_pss in order to see the error message however it doesnt show the errors, please suggest what could be the reason

Harsheenajunejo avatar May 10 '20 08:05 Harsheenajunejo

Hello,

->getLastError(); function just returns query errors. You can check #783 for DB connection control example.

darkcavalry avatar May 24 '20 22:05 darkcavalry