define('DB_HOST','localhost');define('DB_USER','root');define('DB_PWD','root');define('DB_NAME','');$install_sql=mysql_connect(DB_HOST,DB_USER,DB_PWD)or die('數(shù)據(jù)庫(kù)連接失敗,請(qǐng)檢查數(shù)據(jù)庫(kù)地址、帳號(hào)、密碼是否有誤');$new_sql="CREATE DATABASE IF NOT EXITS `shop`";mysql_query($new_sql)or die('創(chuàng)建數(shù)據(jù)庫(kù)失敗'.mysql_error());代碼如上,但是出錯(cuò)了創(chuàng)建數(shù)據(jù)庫(kù)失敗You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'EXITS `shop`' at line 1如果去掉IF NOT EXITS可以新創(chuàng)建,但是如果已有同名數(shù)據(jù)庫(kù)則會(huì)創(chuàng)建失敗,這是什么原因啊,玩不動(dòng)啊
- 1 回答
- 0 關(guān)注
- 1592 瀏覽
添加回答
舉報(bào)
0/150
提交
取消