<?php mysqli_report(MYSQLI_REPORT_STRICT) ?>
was not enough for me to enable exception throwing. I had to write this:
<?php mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); ?>
PHP - Manual: mysqli_sql_exception
2024-11-15
(PHP 5, PHP 7, PHP 8)
mysqli异常类
出现错误的sql状态
<?php mysqli_report(MYSQLI_REPORT_STRICT) ?>
was not enough for me to enable exception throwing. I had to write this:
<?php mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); ?>
官方地址:https://www.php.net/manual/en/class.mysqli-sql-exception.php