Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

LinkedIn Learning

PHP: Exporting Data to Files

via LinkedIn Learning

Overview

Learn how to export data from a database with PHP in a variety of formats, including: rich text, CSV, Excel, Word, OpenOffice spreadsheets and documents, and even XML.

Syllabus

Introduction
  • Welcome
  • What you should know before watching this course
  • Using the exercise files
1. Setting Up
  • Loading the test data into a database
  • Querying the database with MySQL Improved
  • Connecting to different databases with PHP Data Objects (PDO)
  • Querying the database with PDO
  • Displaying the data in a webpage
  • Autoloading classes
2. Basic File Formats
  • Outputting the database result to a text file
  • Outputting the result as a CSV file
  • Introducing the Base class for file downloads
  • Using the Text class for greater control over output
  • Controlling CSV options with the Csv class
  • Saving the data to a local file
3. Generating a Spreadsheet
  • Introducing PHPExcel
  • Setting properties and defaults in PHPExcel
  • Setting the spreadsheet's print options
  • Populating an Excel spreadsheet with data
  • Formatting columns in PHPExcel
  • Downloading the data as a .xlsx file
  • Creating a spreadsheet in the OpenDocument format
  • Creating columns and headers in Fusonic SpreadsheetExport
  • Adding the data and downloading as a .ods file
4. Exporting as Rich Text Format
  • Installing PHPRtfLite
  • Defining the page margins and the footer
  • Setting heading and paragraph styles
  • Adding the data and outputting a .rtf file
5. Exporting to Word Processor Formats
  • Understanding the basic process
  • Merging XML documents with XSLT
  • Preparing a directory to generate the output
  • Generating XML from a database result
6. Generating an OpenDocument Text File
  • Creating a .odt file to use as a template
  • Inspecting the structure of an OpenDocument text file
  • Extracting the main content file from a .odt document
  • Converting the main content file to XSLT
  • Outputting the database result as a .odt file
7. Generating a Microsoft Word File
  • Creating a .docx file to use as a template
  • Extracting the main content file from a Word document
  • Formatting the main content file
  • Converting the main content file to XSLT
  • Outputting the database result as a .docx file
  • Offering a choice of download formats
Conclusion
  • Goodbye

Taught by

David Powers

Reviews

Start your review of PHP: Exporting Data to Files

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.