PHP一键将数据库数据生成excel表格导出,无依赖插件库

"localhost","user"=>"root","password"=>"root","base"=>"test");
$run_mysql = mysqli_connect($array["dizhi"],$array["user"],$array["password"],$array["base"]); 
$sql="select * from test";
$result=mysqli_query($run_mysql,$sql);
echo "表头1\t表头2\t表头3\n";
while($row=mysqli_fetch_array($result)){
    echo $row[0]."\t".$row[1]."\t".$row[2]."\n";
}
?>

 

你可能感兴趣的:(PHP一键将数据库数据生成excel表格导出,无依赖插件库)