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('数据库连接失败,请检查数据库地址、帐号、密码是否有误');
$new_sql="CREATE DATABASE IF NOT EXITS `shop`";
mysql_query($new_sql)or die('创建数据库失败'.mysql_error());
代码如上,但是出错了
创建数据库失败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可以新创建,但是如果已有同名数据库则会创建失败,这是什么原因啊,玩不动啊
qq_雨月残寒_0