PHP and MySQL Training

In this PHP training course, students will learn to create database-driven websites using PHP and MySQL or the database of their choice. The class also covers SQL basics.

Goals
  1. Learn how PHP works.
  2. Learn the basic syntax of PHP.
  3. Learn to create dynamic interactive pages with PHP.
  4. Learn to manipulate files with PHP.
  5. Learn to work with arrays in PHP.
  6. Learn to validate forms with PHP.
  7. Learn to write functions in PHP.
  8. Learn to manipulate and manage database data with PHP.
  9. Learn to authenticate users with PHP.
  10. Learn to manage sessions with PHP.
  11. Learn to work with the MDB2 package.
  12. Learn advanced form validation with regular expressions.
  13. Learn to send email with PHP.
  14. Understand how MySQL works.
  15. Learn to use SQL to output reports with MySQL.
  16. Learn to modify MySQL data with SQL.
Outline
  1. PHP Basics
    1. Welcome to the Server-side
      1. What is a web server?
      2. Dynamic Websites
    2. Google Chrome DevTools: Network Tab
      1. Status Codes
    3. How PHP Works
      1. The php.ini File
      2. PHP Tags
      3. Hello, World!
    4. Comments
    5. PHP Statements and Whitespace
    6. PHP Functions
    7. php.net
    8. Exercise: Using php.net
    9. Variables
      1. Variable Types
      2. Variable Names (Identifiers)
      3. Type Juggling and Casting
      4. Hello Variables!
    10. Exercise: First PHP Script
    11. Variable Scope
      1. Superglobals
    12. Single Quotes vs. Double Quotes
    13. Concatenation
    14. Passing Variables on the URL
    15. Exercise: Passing Variables via the Query String
    16. User-defined Functions (UDFs)
      1. Defining and Calling Functions
      2. Default Values
      3. Variable Scope
      4. By Reference vs. By Value
    17. Introduction to the Poet Tree Club
    18. Including Files
      1. require
      2. require_once
    19. Exercise: Using Header and Footer Includes
    20. Constants
    21. Error Reporting
    22. Exercise: Displaying Errors
    23. Including a Secure Configuration File
    24. Exercise: Including a Configuration File
  2. Flow Control
    1. if / if-else / if-elseif-else
      1. Simple if Condition
      2. if-else Condition
      3. if-elseif-else statement
      4. False Equivalents: Falsy Values
    2. switch/case
    3. Ternary Operator
    4. Exercise: Working with Conditions
    5. Loops
      1. while
      2. dowhile
      3. for
      4. break and continue
    6. Exercise: Working with Loops
  3. Arrays
    1. Indexed Arrays
      1. Initializing Arrays
      2. Appending to an Array
      3. Reading from Arrays
      4. Looping through Arrays
    2. Exercise: Working with Indexed Arrays
    3. Associative Arrays
      1. Initializing Associative Arrays
      2. Reading from Associative Arrays
      3. Looping through Associative Arrays
      4. Superglobal Arrays
    4. Exercise: Working with Associative Arrays
    5. Multi-dimensional Arrays
      1. Reading from Two-dimensional Arrays
      2. Looping through Two-dimensional Arrays
      3. Two-dimensional Associative Arrays
      4. Non-tabular Multi-dimensional Arrays
    6. Array Manipulation Functions
    7. in_array() Function
    8. Exercise: Array Practice
  4. PHP and HTML Forms
    1. HTML Forms
      1. How HTML Forms Work
    2. Form Submissions
    3. Sanitizing Form Data
      1. htmlspecialchars()
      2. htmlentities()
      3. filter_var()
      4. filter_input()
    4. Validating Form Data
      1. Was the Field Filled In?
      2. Is the Entered Value an Integer?
      3. Is it an Email?
      4. Is it a Valid Password and Do the Passwords Match?
      5. Do the Combined Values Create a Valid Date?
      6. Did the User Check the Box?
    5. Exercise: Processing Form Input
  5. String Manipulation
    1. Formatting Strings
      1. Concatenation
      2. String Manipulation Functions
      3. Examples of String Functions
    2. Exercise: Working with String Manipulation Functions
  6. Reusing Code and Writing Functions
    1. Including Files
      1. require
      2. require_once
    2. Exercise: Adding a Header and Footer
      1. auto_prepend_file and auto_append_file
    3. User Functions
      1. Defining and Calling Functions
      2. Default Values
      3. Variable Scope
      4. By Reference vs. By Value
    4. Form Processing
      1. Code Organization
    5. Exercise: Form Validation and Presentation Functions
  7. Simple SELECTs
    1. Introduction to the Northwind Database
    2. Some Basics
      1. Comments
      2. Whitespace and Semi-colons
      3. Case Sensitivity
    3. SELECTing All Columns in All Rows
    4. Exercise: Exploring the Tables
    5. SELECTing Specific Columns
    6. Exercise: SELECTing Specific Columns
    7. Sorting Records
      1. Sorting by a Single Column
      2. Sorting By Multiple Columns
      3. Ascending and Descending Sorts
    8. Exercise: Sorting Results
    9. The WHERE Clause and Logical Operator Symbols
      1. Checking for Equality
      2. Checking for Inequality
    10. Exercise: Using the WHERE Clause to Check for Equality or Inequality..252
      1. Checking for Greater or Less Than
    11. Exercise: Using the WHERE Clause to Check for Greater or Less Than.256
    12. Checking for NULL
    13. Exercise: Checking for NULL
    14. WHERE and ORDER BY
    15. Exercise: Using WHERE and ORDER BY Together
    16. Checking Multiple Conditions with Boolean Operators
      1. AND
      2. OR
      3. Order of Evaluation
    17. Exercise: Writing SELECTs with Multiple Conditions
    18. The WHERE Clause and Logical Operator Keywords
      1. The BETWEEN Operator
      2. The IN Operator
      3. The LIKE Operator
      4. The NOT Operator
    19. Exercise: More SELECTs with WHERE
  8. Advanced SELECTs
    1. Calculated Fields
      1. Concatenation
      2. Mathematical Calculations
      3. Aliases
    2. Exercise: Calculating Fields
    3. Aggregate Functions and Grouping
      1. Aggregate Functions
      2. Grouping Data
    4. Exercise: Working with Aggregate Functions
      1. Selecting Distinct Records
    5. Built-in Data Manipulation Functions
      1. Common Math Functions
      2. Common String Functions
      3. Common Date Functions
    6. Exercise: Data Manipulation Functions
  9. Subqueries, Joins and Unions
    1. Subqueries
    2. Exercise: Subqueries
    3. Joins
      1. Table Aliases
      2. Multi-table Joins
    4. Exercise: Using Joins
    5. Outer Joins
      1. Unions
      2. UNION ALL
    6. UNION Rules
    7. Exercise: Working with Unions
  10. Inserting, Updating and Deleting Records
    1. INSERT
    2. Exercise: Inserting Records
    3. UPDATE
    4. DELETE
    5. Exercise: Updating and Deleting Records
  11. Managing Data
    1. Querying a Database
      1. mysqli() Overview
      2. mysqli Methods and Properties
      3. Inserting and Updating Records
    2. Exercise: Inserting Records
    3. mysqli Prepared Statements
  12. MDB2
    1. Advantages and Disadvantages of MDB2
      1. Why use a database abstraction layer?
      2. When not to use a database abstraction layer?
    2. Using MDB2
    3. Exercise: Creating a Customer Report
  13. Authentication with PHP and SQL
    1. The Registration Process
    2. Passwords and Pass Phrases
    3. Registration with Tokens
    4. Exercise: Creating a Registration Form
    5. Sessions
      1. Session Variables
    6. Cookies
    7. Exercise: Logging in
    8. Logging Out
    9. $_REQUEST Variables
    10. Exercise: Resetting the Pass Phrase
  14. Regular Expressions
    1. Perl-compatible Regular Expression Functions
      1. preg_match()
      2. preg_replace()
      3. Regular Expression Tester
    2. Regular Expression Syntax
      1. Start and End ( ^ $ )
      2. Number of Occurrences ( ? + * {} )
      3. Common Characters ( . \d \D \w \W \s \S )
      4. Grouping ( [] )
      5. Negation ( ^ )
      6. Subpatterns ( () )
      7. Alternatives ( | )
      8. Escape Character ( \ )
    3. Form Validation Functions with Regular Expressions
  15. Session Control and Cookies
    1. Sessions
      1. Configuring Sessions
      2. Session Functions
    2. Cookies
    3. Exercise: Authentication with Session Control
  16. Sending Email with PHP
    1. mail()
      1. Shortcomings of mail()
    2. Setting Up PHPMailer
      1. Get and Install the Latest Version of PHPMailer
    3. Mail Server
    4. Exercise: Including a Mail Configuration File
    5. Sending Email with PHPMailer
    6. PHPMailer Methods and Properties
    7. Exercise: Creating a Contact Form
  17. File System Management
    1. Opening a File
      1. fopen()
    2. Reading from a File
      1. fgets()
    3. Writing to a File
      1. fwrite()
    4. Exercise: Writing to a File
    5. File Locking
      1. flock()
    6. Uploading Files via an HTML Form
    7. Getting File Information
    8. More File Functions
    9. Directory Functions
      1. Getting a Directory Listing
    10. Exercise: Creating a Resume Management Page
Class Materials

Each student in our Live Online and our Onsite classes receives a comprehensive set of materials, including course notes and all the class examples.

Class Prerequisites

Experience in the following is required for this PHP class:

  • HTML

Experience in the following would be useful for this PHP class:

  • CSS
  • Basic Programming
  • XML