我正在跨越一個錯誤來試圖將數據從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