建立連接的同時不能打開數(shù)據(jù)庫
我如果這樣$mysqli = new mysqli('localhost','root','root','test');就會有錯誤信息
Warning: mysqli::mysqli() [mysqli.mysqli]: (42000/1049): Unknown database 'test' in?C:\Users\Administrator\PhpstormProjects\Char\mysqli_connect_1.php?on line?13
Connect Error:Unknown database 'test'
這樣去就沒問題$mysqli = new mysqli('localhost','root','root');
$mysqli->select_db('test');
求大神解答
2017-04-28
要學(xué)會看錯,英文不好的話,建議用谷歌翻譯,因為這個翻譯比較標(biāo)準(zhǔn)
2017-04-28
你的錯誤應(yīng)該是:
警告:mysqli :: mysqli()[mysqli.mysqli]:(42000/1049):未知的數(shù)據(jù)庫'test'在C:\ Users \ Administrator \ PhpstormProjects \ Char \ mysqli_connect_1.php第13行連接錯誤:未知數(shù)據(jù)庫'test'
test是未知的數(shù)據(jù)庫,你確定有這個數(shù)據(jù)庫