假如數(shù)據(jù)庫賬號(hào)寫錯(cuò)了 那在拋出異常之前 PHP就會(huì)報(bào)錯(cuò)的啊?拋出異常沒卵用啊
Warning: mysql_connect(): Access denied for user 'rosot'@'localhost' (using password: YES) in?D:\phpStudy\WWW\APPapi\db.php?on line?29
Fatal error: Uncaught exception 'Exception' with message 'mysql connect errorAccess denied for user 'rosot'@'localhost' (using password: YES)' in D:\phpStudy\WWW\APPapi\db.php:33 Stack trace: #0 D:\phpStudy\WWW\APPapi\db.php(46): Db->connect() #1 D:\phpStudy\WWW\APPapi\list.php(6): require_once('D:\\phpStudy\\WWW...') #2 {main} thrown in?D:\phpStudy\WWW\APPapi\db.php?on line?33
2018-02-06
那為什么要把數(shù)據(jù)庫賬號(hào)打錯(cuò)呢?都封裝在類里面了