我正在跨越一个错误来试图将数据从MySQL使用PHP错误出口MYSQL数据为PDF文件,PHP脚本
这里是我的PHP代码导出为PDF:
<?php
require('fpdf.php');
include ('connection.php');
$data = mysql_query("SELECT * FROM sold WHERE imei = '87712839712893'");
$result = mysql_fetch_array($data);
$saledate = $result['saledate'];
$price = $result['sellingprice'];
$pdf=new FPDF();
$pdf->AddPage();
$pdf->SetFont('arial','B',10);
$pdf->Cell(40,10,'$saledate');
$pdf->SetFont('arial','B',30);
$pdf->Cell(40,10,'$price');
$pdf->Output();
?>
这里的错误
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\POS\v2\tuto1.php on line 7
FPDF error: Some data has already been output, can't send PDF file
mysql_error()告诉了什么? – 2011-06-08 17:30:24