版本 PHP 7+請仔細(xì)看我的問題。我知道 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!';這個(gè)錯(cuò)誤可以被捕獲。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!';無法捕獲此錯(cuò)誤。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所以,我想知道可以捕獲哪些類型的錯(cuò)誤。然后我可以做些什么。讓腳本繼續(xù)。
- 1 回答
- 0 關(guān)注
- 122 瀏覽
添加回答
舉報(bào)
0/150
提交
取消