<?php/** * 由 runner.han 创建 * 阳光下无新鲜事 */header('Content-type:text/html;charset=utf-8'); include_once 'header.php';include_once 'inc/config.inc.php';$dbhost=DBHOST;$dbuser=DBUSER;$dbpw=DBPW;$dbname=DBNAME;$dbport=DBPORT;$mes_connect='';$mes_create='';$mes_data='';$mes_ok='';if(isset($_POST['submit'])){ $link = mysqli_connect($dbhost, $dbuser, $dbpw ,$dbport); //判断数据库连接 //if(!@mysqli_connect($dbhost, $dbuser, $dbpw)){ //if(!@mysqli_connect("localhost", "root", "root", "13306")){ if(!$link){ echo '数据连接失败,请仔细检查inc/config.inc.php的配置'; echo "Error: Unable to connect to MySQL." . PHP_EOL; echo "Debugging errno: " . mysqli_connect_errno() ; echo "Debugging error: " . mysqli_connect_error() ; exit; //exit(mysqli_connect_error()); } $link=mysqli_connect(DBHOST, DBUSER, DBPW); $mes_connect.="<p class='notice'>数据库连接成功!
";