标签:
header(‘content-type:text/html;charset=utf-8‘);
//链接数据库
$link = mysqli_connect(‘127.0.0.1‘,‘root‘,‘111111‘,‘test‘);
if(!$link){
die(‘链接数据库失败!‘.mysqli_error());
}
//设置字符集,选择数据库
mysqli_set_charset($link, "utf-8");
//准备sql语句
$sql = ‘select * from emp_info‘;
$result = mysqli_query($link,$sql);
$emp_info = array();
while($row = mysqli_fetch_assoc($result)){
$emp_info[] = $row;
}
define(‘APP‘,‘TEST‘);
require ‘./list_html.php‘;
标签:
原文地址:http://www.cnblogs.com/zhizhengyo/p/5558197.html