troubleshooting Question

Problem displaying data from MSSql using FPDF

Avatar of dogsareit
dogsareitFlag for United States of America asked on
PDFPHPMicrosoft SQL Server
5 Comments1 Solution92 ViewsLast Modified:
I am in need of some help. I am using FPDF, extracting data from a MS  SQL Server 2014 table. I am using PHP v5.6.25.
I am rather confused about two columns that are giving me grief. One is a money column and the other is a date column.
The money column displays 4 decimals and I need to display it as 2 decimal places.
The date column will not display at all and it stalls the creation of the pdf.
With the date column, I decided to explode the date, reassemble it as a string in the order that I need to display, MM-DD-YYYY, and it will not display.
If I comment it out, it displays the PDF.


This is my select statement:
         $sql = "select SupplierCode,ConfirmNbr,AmtRcvd,DateRcvd, Description,IDOC,InvoiceNbr from importCmsReceipts where  AgencyId = $strAgencyId ";	 

And this is what I have tried as to displaying the date - doesn't work.
$strDateRcvd = $row['DateRcvd'];
$strArray = explode('-',$strDateRcvd);
$strDate = strval($strArray[2]) . '-' . strval($strArray[1]) .'-' . strval($strArray[0]);
$pdf->Cell(30,15,'$strDate');

I am thinking I need to change my sql select statement to put both the money and date columns in the format that I need.
How can I fix this and what am I doing wrong with the date and money columns ??
Any help appreciated.
ASKER CERTIFIED SOLUTION
dogsareit
Owner

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros