This site uses Akismet to reduce spam. We will use FPDF libs function to generate pdf file with header and footer. We'll see in this PHP Tutorial, How to Export Data from MySQL to CSV File in PHP.It's not uncommon to import and export data from database management system. Hi to all beginners in PHP and MySQL. Want to use this but shouldn’t be using PDO…Is there an alternative? We have a MySQL table containing the same data that we have in a text file for previous FPDF-PDF generation tutorial. 15 Amazing Shortcuts You Aren't Using - Duration: 12:34. So, let's create db_config.php file and put bellow code: db_config.php