0
MySQLi 클래스를 확장하는 사용자 정의 데이터베이스 클래스가 있습니다.클래스 확장에서 MySQLi 오류 받기
__construct
메서드에서 parent
을 사용하여 데이터베이스에 연결합니다.
다음은 쿼리가 성공적이지 않은 경우 쿼리의 일부입니다. 서버에서 오류를 반환하려면 어떻게해야합니까?
$query = parent::query($querystr, $resultmode);
if (!$query) {
$error = str_replace(
'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use',
'Syntax Error',
mysqli_error(self::getInstance()));
\core\debug::sqlerrorlog($error);
} else {
\core\debug::sqlSuccess();
}