PHP ??? ?? ?? ??????
?? conn.php ??? ?????
??? ??? ????.
<?php header("Content-type: text/html; charset=utf-8");//設置編碼 $con = mysql_connect("localhost","root","root") or die("數(shù)據庫連接失敗"); mysql_select_db('login') or die("指定的數(shù)據庫不能打開"); mysql_query("set names utf8");//設置數(shù)據庫的字符集 ?>
?? ?? ???? ?????. ? ??? ???? ??? ??? ??? ???? ????
?? ?? ??????? ?????.
localhost ?? ?? ??? ?? ?? ????
??? 127.1.1.1? ??
$con = mysql_connect("127.1.1.1","username","password") ?? die("?????? ??)? ??? ? ????. failed" );
?? ? ?? ?? ??? ?? ??????? ???. ?????? ??? login