a
<?php/** * Created by PhpStorm. * User: Administrator * Date: 2018/3/26 0026 * Time: 13:40*/ define("HOST",'localhost'); define("USER",'root'); define("PWD",'root'); define("DBNAME",'vote'); $mysqli=new mysqli(HOST,USER,PWD,DBNAME); if($mysqli->connect_errno){ die('数据库链接出错'.$mysqli->connect_error); }else{ echo 1; }
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/3/26 0026
* Time: 13:40
*/
define("HOST",'localhost');
define("USER",'root');
define("PWD",'root');
define("DBNAME",'vote');
$mysqli=new mysqli(HOST,USER,PWD,DBNAME);
if($mysqli->connect_errno){
die('数据库链接出错'.$mysqli->connect_error);
}else{
echo 1;
}