Created
July 10, 2017 08:58
-
-
Save why168/ed8e23d59ad367ab15d890dc7d5168fc to your computer and use it in GitHub Desktop.
数据库配置文件
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* 数据库配置文件 | |
* Created by PhpStorm. | |
* User: edwin | |
* Date: 2017/6/22 | |
* Time: 19:44 | |
*/ | |
require 'db_config.php'; | |
$mysqli = new mysqli(DB_HOST, DB_USERNAME, DB_PASSWORD, DB_NAME); //链接数据库 | |
if ($mysqli->connect_errno) { | |
printf("Connect failed: %s\n", $mysqli->connect_error . '...'); | |
exit(); | |
} else { | |
printf("连接成功..."); | |
$mysqli->set_charset("utf8"); | |
// var_dump($mysqli->get_charset()); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment