钟毅2017-10-04 14:35:36
Generally speaking, this file is found in CONFIG.inc.php of the website, which is the global database configuration file. In the CONFIG directory in the root directory, this file stores the connection file mentioned on the first floor. THINKPHP is generally placed in the COMMON file directory. The file content is an array.
数据分析师2017-09-30 23:10:27
How can I connect to my local database? Where did the database he connected to come from? -PHP Chinese website Q&A-How can I connect to my local database? Where did the database he connected to come from? -PHP Chinese website Q&A
Please watch and learn.
迷茫2016-12-20 14:23:17
用连接Mysqli的方法试试。
//创建对象并打开连接,最后一个参数是选择的数据库名称
$mysqli = new mysqli('localhost','root','','volunteer');
//检查连接是否成功
if (mysqli_connect_errno()){//注意mysqli_connect_error()新特性
die('Unable to connect!'). mysqli_connect_error();
}