如何使用mysql数据创建pdf文件? [英] How to create pdf file with mysql data?
本文介绍了如何使用mysql数据创建pdf文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
谁能给我一个简单的例子,如何用mysql数据创建pdf文件?我使用fpdf http://www.fpdf.org/进行pdf创建. 我要打印这些数据:
Can anyone give me simple example, how to create pdf file with mysql data? Im using fpdf http://www.fpdf.org/ for pdf creation. I want to print these data:
$result = mysql_query("SELECT Name, Profesion, Email FROM customers")
or die(mysql_error());
if(mysql_num_rows($result) > 0) {
while($row = mysql_fetch_assoc($result)) {
echo '
<td width="200px">'.$row['Name'].'</td>
<td width="200px">'.$row['Profesion'].'</td>
<td> width="200px">'.$row['Email'].'</td>'; }
}
推荐答案
您是否看过他们网站上的脚本部分?他们有一些从MySQL创建PDF表/报告的好例子.希望这会有所帮助.
Have you looked at the scripts section on their site? They have a few good examples of creating a PDF table/report from MySQL. Hope this helps.
http://www.fpdf.org/en/script/index.php
这篇关于如何使用mysql数据创建pdf文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文