$createDb = $mysqli->query("如果不存在则创建数据库".$dbname);

问题描述 投票:0回答:1
**Fatal error**: Uncaught mysqli_sql_exception: 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 '' at line 1 in /home/sites/38b/d/db91d1a8eb/public_html/unitecherp/install/php/DbImport.php:35 Stack trace: #0 /home/sites/38b/d/db91d1a8eb/public_html/unitecherp/install/php/DbImport.php(35): mysqli-\>query('CREATE DATABASE...') #1 /home/sites/38b/d/db91d1a8eb/public_html/unitecherp/install/index.php(111): Php\\DbImport-\>createDatabase(Array) #2 {main} thrown in **/home/sites/38b/d/db91d1a8eb/public_html/unitecherp/install/php/DbImport.php** on line **35**

$createDb = $mysqli->query("CREATE DATABASE IF NOT EXISTS ".$dbname);
php mariadb
1个回答
-1
投票

您已经设置了数据库连接字符串吗?

可以提供更详细的代码吗?

© www.soinside.com 2019 - 2024. All rights reserved.