i am coming across an error while trying to export data from MYSQL to PDF using PHP
Here's my php code:
<?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();
?>
Here's the ERROR
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