时间:2021-07-01 10:21:17 帮助过:16人阅读
header ( "Content-Type:text/html; charset=utf-8" );mysql php utf8 数据库 分享到:
$host = "localhost";
$user = "root";
$password = "";
@$conn = mysql_connect($host,$user,$password) or die("数据库连接失败,请检查数据库配置!" . mysql_error());
$tableName = "viuoo";
mysql_select_db($tableName,$conn) or die('数据库表选择出错,请检查数据库表名是否正确!');
mysql_query("SET NAMES 'utf-8'");
$dm = "SELECT * FROM user";
$result = mysql_query($dm,$conn);
while($res = mysql_fetch_row($result)){
print_r($res);
}
?>