Welcome to PHP MySQL Examples.

Please note this project is still under development. The majority of the examples are incomplete and will be of little benefit to those studying PHP and MySQL interaction. Please visit the Tizag website for comprehensive elementary PHP/MySQL instruction.

Thank You.

The entire contents of the source book were updated to correspond to the latest versions of PHP and MySQL.

  • Introduction
  • Chapter 1: Introduction to PHP
    • Basic Syntax
    • Sending Data to the Web Browser
    • Understanding PHP, HTML, and White Space
    • Writing Comments
    • What Are Variables?
    • About Strings
    • About Numbers
    • About Constants
    • Single vs. Double Quotation Marks
  • Chapter 2: Programming with PHP
    • Creating an HTML Form
    • Handling an HTML Form
    • Managing Magic Quotes
    • Conditionals and Operators
    • Validating Form Data
    • What Are Arrays?
    • For and While Loops
  • Chapter 3: Creating Dynamic Web Sites
    • Including Multiple Files
    • Handling HTML Forms with PHP Redux
    • Making Sticky Forms
    • Creating and Calling Your Own Functions
    • Variable Scope
    • Date and Time Functions
    • Sending Email
  • Chapter 4: (not active) Introduction to SQL and MySQL
    • Choosing Your Column Types
    • Choosing Other Column Properties
    • Using the mysql Client
    • Creating Databases and Tables
    • Inserting Records
    • Selecting Data
    • Using Conditionals
    • Using LIKE and NOT LIKE
    • Sorting Query Results
    • Limiting Query Results
    • Updating Data
    • Deleting Data
    • Using Functions
  • Chapter 5: (not active) Advanced SQL and MySQL
    • Database Design
    • Performing Joins
    • Grouping Selected Results
    • Creating Indexes
    • Using Different Table Types
    • Performing FULLTEXT Searches
    • Database Optimization
  • Chapter 6:(not active) Error Handling and Debugging
    • General Error Types and Debugging
    • Displaying PHP Errors
    • Adjusting Error Reporting in PHP
    • Creating Custom Error Handlers
    • Logging PHP Errors
    • PHP Debugging Techniques
    • SQL and MySQL Debugging Techniques
  • Chapter 7: (not active) Using PHP with MySQL
    • Modifying the Template
    • Connecting to MySQL and Selecting the Database
    • Executing Simple Queries
    • Retrieving Query Results
    • Ensuring Secure SQL
    • Counting Returned Records
    • Updating Records with PHP
  • Chapter 8: Web Application Development
    • Adjusting Behavior for Server Settings
    • Sending Values to a Script Manually
    • Using Hidden Form Inputs
    • Editing Existing Records
    • Paginating Query Results
    • Making Sortable Displays
    • Understanding HTTP Headers
  • Chapter 9: Cookies and Sessions
    • Using Cookies
    • Using Sessions
    • Sessions and Cookies
    • Improving Session Security
  • Chapter 10: Web Application Security
    • More Secure Form Validation
    • Handling HTML
    • Validating Data by Type
    • Form Validation with JavaScript
    • Regular Expressions
    • Database Security and Encryption
  • Chapter 11: (not active) Extended Topics
    • Handling File Uploads
    • PHP and JavaScript
    • Using Output Buffering
    • Using the Improved MySQL Extension
    • New MySQL Features
    • Using PEAR
  • Chapter 12: (not active) Example—Content Management
    • Creating the Template
    • Creating the Basic Pages
    • Managing URLs
    • ManagingFiles
  • Chapter 13: (not active) Example—User Registration
    • Creating the Templates
    • Writing the Configuration Scripts
    • Creating the Home Page
    • Registration
    • Activating an Account
    • Logging In and Logging Out
    • Password Management
  • Chapter 14: (not active) Example—E-Commerce
    • Creating the Database
    • The Administrative Side
    • Creating the Public Template
    • The Product Catalog
    • The Shopping Cart
    • Recording the Orders
  • Appendix A: Installation
    • Installation on Windows
    • Installation on Mac OS X
    • MySQL Permissions
    • Testing Your Installation
    • Configuring PHP
  • Appendix B: Reference
  • Appendix C: Resources