乔山办公网我们一直在努力
您的位置:乔山办公网 > excel表格制作 > 我用<em>PHP</em>做了个查询,从Mysql中查询出来的数据显示在表格...-php s

我用<em>PHP</em>做了个查询,从Mysql中查询出来的数据显示在表格...-php s

作者:乔山办公网日期:

返回目录:excel表格制作


你现在发的这个码是对的额!
现在有什么问题呢?
你好,Java框架Bootstrap jQuery SpringMVC Hibernate 安全权限
有兴趣,+qiu裙--> 378 437 335

PHP 有专门做excel的类,比较流行的是phpexcel。官方网址:http://phpexcel.codeplex.com/
可以到他们网站上下载,毕竟官方的是最稳定的,也是最放心的嘛。下载地址:http://phpexcel.codeplex.com/releases/view/45412
网站是英文的不过国内也有很多中文的教程,可以在网上搜一下。
下载了之后,里面有很多例子,如果要求的不是很复杂,前一两个例子看完后就可以实现你要的效果了。
header('Content-type: text/html; charset=utf-8');
header("Content-type:application/vnd.ms-excel;charset=UTF-8");
header("Content-Disposition:filename=test.xls");
//有上面这些头信息 下面输出你要得数据就可以了
echo $a."\t";echo $b."\t\n";
//这里zhidao的\t是下一个数据,\t\n是换行
//自己试试把
如果不是要写程序 ,只是想取得数据库中数据的excel phpmyadmin导出文件有excel格式的

不要用 \t 制表符。

用<table><tr><td></td></tr></table>

<?php 
header("Content-type:application/vnd.ms-excel");  //excel头信息
header("Content-Disposition:attachment;filename=test_data.xls");
?>
 
<table class="table" border="1">
            <thead>
              <tr>
                <th>编号: </th>
                <th>门店 </th>
                <th>手机号码 </th>
              </tr>
            </thead>
<tbody>
              <?php 
 
//数据库7a64e59b9ee7ad94362查询 
$dosql->Execute("select * from link_log  order by id desc");
$i=$dosql->GetTotalRow();
while($result=$dosql->GetArray()){
    $host=$result['host']; //门店
    $mobile=$result['mobile']; //手机号码
 
 
?>
            <td ><?php echo $i;?></td>
              <td ><?php echo $host;?></td>
              <td ><?php echo $mobile;?></td>
            </tr>
            <?php 
$i--;

?>
              </tbody>
</table>

相关阅读

  • <em>excel</em>2010 <em>sql</em>完全<

  • 乔山办公网excel表格制作
  • 合并计算、数据百透视表、SQL都可以实现。具体可参考“Excel疑难度千寻千解丛书”问的《Excel2010数据透视表应用答大全》或《Excel2010 SQL完全应用》等读本。免费视频教版程参考如下:
  • -sql 访问excel,sqlexcel

  • 乔山办公网excel表格制作
  • 将度rs.Open "Select * From [sheet1$] where 序号问答=a",conn,adOpenStatic改为专rs.Open "Select * From [sheet1$] where 序号="&a&"",conn,adOpenStatic再试属试
关键词不能为空
极力推荐

ppt怎么做_excel表格制作_office365_word文档_365办公网