版本 PHP 7+请仔细看我的问题。我知道 php7_mysql 的问题。那不是我的问题。first:$i = 0;try { if ( $i == 0 ) $link = mysqli_connect("1.1.1.1", "my_user", "my_password", "my_db"); else echo 'Another link.';} catch (Exception $e) { echo 'Caught exception: ', $e->getMessage(), "\n"; $i = 1; goto first;}// Continue executionecho 'repair complete!';这个错误可以被捕获。Warning: mysqli_connect(): (HY000/2002):repair complete!但是,如果它看起来像这样first:$i = 0;try { if ( $i == 0 ) $link = mysql_connect("1.1.1.1", "my_user", "my_password", "my_db"); else echo 'Another link.';} catch (Exception $e) { echo 'Caught exception: ', $e->getMessage(), "\n"; $i = 1; goto first;}// Continue executionecho 'repair complete!';无法捕获此错误。Fatal error: Uncaught Error: Call to undefined function mysql_connect() in D:\wamp64\www\test.php:409 Stack trace: #0 {main} thrown in D:\wamp64\www\test.php on line 409所以,我想知道可以捕获哪些类型的错误。然后我可以做些什么。让脚本继续。
1 回答
- 1 回答
- 0 关注
- 104 浏览
添加回答
举报
0/150
提交
取消