PHP怎么将查询结束导出Excel
时间:2021-07-01 10:21:17
帮助过:20人阅读
PHP如何将查询结束导出Excel
用户编号 |
用户名 |
if(!empty($_POST["u_num"])){
$u_num = "where u_id='"."{$_POST['u_num']}"."'";
}
$sql = "select * from msd.dbo.user";
$query = sqlsrv_query($conn,$sql);
if( $query === false) {
die( print_r( sqlsrv_errors(), true) );
}
while($row = sqlsrv_fetch_array($query)) {
echo "$row[0] | $row[1] |
";
}
sqlsrv_free_stmt( $query);
sqlsrv_close( $conn);
?>
PHPexcel
导出
汇出
分享到:
------解决方案--------------------