Tag: ob start

将MySQL表保存到本地计算机

起初,我想请求我的英语,但是我有一个问题 我以这种方式创build一个表格forms的数据库: //the connection goes right, so I don't put it into my code <table id="database"> <tr> <th>Title1</th> <th>Title2</th> <th>Title3</th> <th>Title4</th> </tr> <?php $result = mysql_query("SELECT * FROM `table`"); while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>".$row['Column1']."</td>"; echo "<td>".$row['Column2']."</td>"; echo "<td>".$row['Column3']."</td>"; echo "<td>".$row['Column4']."</td>"; echo "</tr>"; } ?> </table> 问题是我试图把这些数据放到文件中,以便将这些列保存在本地计算机上,因为我想在线删除这个表。 我已经尝试过TCPDF和html2pdf 没有义务把这些文件放在pdf ,但我希望这些文件能够保存。 我希望你能帮助我。 更新:有两个很好的解决scheme。 但是我的Acrobat […]

codeigniter导出到excel在localhost上运行良好,服务器上出现错误

这是我的export_to_excel助手的代码: function export_to_excel($query, $filename='exceloutput') { $headers = ''; // just creating the var for field headers to append to below $data = ''; // just creating the var for field data to append to below $obj =& get_instance(); $fields = $query->list_fields(); if ($query->num_rows() == 0) { echo '<p>The table appears to have no data.</p>'; } […]