Рет қаралды 6,516
Connect to MySQL table and execute Query to collect multiple rows of data from sample table and display the same inside PDF document using FPDF class in PHP
www.plus2net.c...
First we will connect to MySQL table by using DBO class in PHP. The connection string we will keep in a separate file and connect to our main script. The connection object we create $dbo we will use for our database management.
We will use one simple SELECT SQL query with LIMIT command to collect 10 records from our sample student table.
SELECT * FROM student LIMIT 0,10
Using this query we can get the records from MySQL database. While displaying each data can be placed within the data Cell and displayed. The tabular format is kept inside a foreach loop and displayed all the rows.
#PDFTABLEMYSQLDATA #recordsinPDFTABLE #DATATABLEINPDF