Hi all,
I am writing a script that uses FPDF to create a PDF file. The script runs a query and should return data but for some reason the variables in the WHERE clause are not working. If I run the query alone standalone it works but when embedded in the script it does not return a result. I am using a class obtains from the FPDF site to produce tables called "PDF_MySQL_Table". This works if I take out the variables for date. Should I be passing the dates in a different way.
The code I am using is:
$pdf=new PDF();
$pdf->AddPage();
$pdf->AddCol('Room',15,'Room','15');
$pdf->AddCol('AuditBy',40,'Audit by');
$pdf->AddCol('LastAudit',40,'Audit date','L');
$pdf->AddCol('SeqID1306',15,'Hot','C');
$pdf->AddCol('SeqID1307',15,'Cold','C');
$pdf->AddCol('Comments13',60,'Comments','L');
//First table: put all columns automatically
$pdf->Table("SELECT Room, AuditBy, DATE_FORMAT(LastAudit,'%d-%m-%Y') AS LastAudit, SeqID1306, SeqID1307, Comments13 FROM Room_Hist WHERE CAST(LastAudit AS Date) BETWEEN " . $_SESSION['WaterFromDate'] ." AND ". $_SESSION['WaterToDate']." AND Complete = 1 ORDER BY Room ASC");
$pdf->Output();
Can anyone see why this sould not work.
Many thanks in advance.
Blackbox