請(qǐng)問在mac下xampp無法讀取mysql的數(shù)據(jù)
報(bào)錯(cuò)信息如下:
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /Applications/XAMPP/xamppfiles/htdocs/test/db.class.php:51 Stack trace: #0 /Applications/XAMPP/xamppfiles/htdocs/test/db.class.php(31): ms_new_mysql->connect() #1 /Applications/XAMPP/xamppfiles/htdocs/test/db.class.php(329): ms_new_mysql->__construct('127.0.0.1', 'root', '', 'mukewang', '', 'utf-8', '0') #2 /Applications/XAMPP/xamppfiles/htdocs/test/data.php(6): include_once('/Applications/X...') #3 {main} thrown in?/Applications/XAMPP/xamppfiles/htdocs/test/db.class.php?on line?51
2017-04-22
檢查一下你的PHP版本,可能你的版本比較新,已經(jīng)拋棄了mysql的連接方式,可以采用mysqli或者PDO的鏈接方式嘗試一下。希望我的回答能幫到你!
2017-04-25
改用其他連接方式,或者用較低版本的PHP,版本<5.50
但還是建議使用mysqli或者pdo方式連接,畢竟mysql方式已經(jīng)被廢棄了