Skip to content

Commit

Permalink
更新安装脚本中链接mysql部分
Browse files Browse the repository at this point in the history
  • Loading branch information
star7th committed Jun 12, 2016
1 parent c76468e commit e11690a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions install/ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,16 @@ function user_sqlite(){
function user_mysql(){
$db_host = $_POST["db_host"] ;
$db_user = $_POST["db_user"] ;
$db_port = $_POST["db_port"] ;
$db_port = $_POST["db_port"] ? $_POST["db_port"] :3306 ;
$db_name = $_POST["db_name"] ;
$db_password = $_POST["db_password"] ;

clear_runtime();//清除缓存

//检测数据库配置是否能链接得上

$con = mysqli_connect($db_host.":".$db_port,$db_user,$db_password);
$r = mysqli_select_db($con, $db_name);
if (!$con || !$r) {
$con = mysqli_connect($db_host,$db_user,$db_password,$db_name,$db_port);
if (!$con ) {
ajax_out("数据库链接错误,请检查配置信息是否填写正确",10002);
exit();
}
Expand Down

0 comments on commit e11690a

Please sign in to comment.