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ù)庫連接失敗,請檢查數(shù)據(jù)庫地址、帳號、密碼是否有誤');$new_sql="CREATE DATABASE IF NOT EXITS `shop`";mysql_query($new_sql)or die('創(chuàng)建數(shù)據(jù)庫失敗'.mysql_error());代碼如上,但是出錯了創(chuàng)建數(shù)據(jù)庫失敗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ù)庫則會創(chuàng)建失敗,這是什么原因啊,玩不動啊
添加回答
舉報
0/150
提交
取消