Getting Started with PHP and MySQL


As the connected world becomes more integrated, companies are attempting to extend the reach of their applications to encompass clients directly. The use of LAMP (Linux, Apache, MySQL, PHP) applications has enabled developers to leverage the power of open source to develop these applications. This course covers the use of PHP to create web-based solutions that can deliver powerful, real-world applications power over an intranet, extranet or the Internet.

The course also introduces MySQL, and shows how it can be used with PHP to create, query, and update data in a relational database.


At the end of this course you will be able to:

  • Use PHP to create a useful website
  • Use and declare variables, constants and operators in PHP
  • Maintain state in PHP web applications using cookies and sessions
  • Use regular expressions to handle text
  • Access company data held in MySQL using PHP Course outline


  • Delegates should have a good grounding in HTML and its fundamental constructs, although an HTML refresher is available. This could be a result of at least 6 months hands-on Web development experience or possibly less if preceded by appropriate training, such as one of our Web programming courses.

  • Alternatively, delegates without this HTML experience should consider attending our 'Building an Effective Website' ( ) for equivalent HTML knowledge.

  • An awareness of database technology, in particular the use of SQL queries would be advantageous.

  • Those delegates who are attending via either virtual or extended classroom will be required to provide two monitors (to view courseware, labs and instructor demos simultaneously)


Chapter 1: Getting Started

  • Getting Started with PHP and MySQL
  • Overview of PHP
  • Documentation
  • PHP setup parameters
  • PHP and database access
  • Basic syntax of a PHP script
  • Running a PHP script
  • Running PHP as a server side script

Chapter 2: PHP Language Basics

  • PHP basic syntax
  • PHP variables
  • Output in PHP
  • PHP constants
  • Fundamental if statement
  • PHP functions
  • PHP data types
  • Getting and setting data type
  • The is_type functions
  • Type casting
  • Empty or set?
  • Common operators
  • Arithmetic expressions
  • Compound assignments
  • Increment and decrement operators
  • String operators
  • Basic OOP

Chapter 3: Lists and Arrays

  • Arrays
  • Indexed arrays
  • Assigning to a list
  • Array to scalar: join
  • Scalar to array: explode
  • Associative arrays
  • Miscellaneous array functions
  • The in_array function
  • The array_search function
  • Arrays of arrays

Chapter 4: PHP in HTML

  • Web application development
  • Server-side processing
  • Server-side processing and PHP
  • Processing forms - GET
  • Creating a link
  • Processing forms - POST
  • A trick with arrays
  • GET or POST?
  • Uploading files (POST)
  • Uploading files (POST)
  • Downloading files
  • State and persistence
  • State management: Cookies
  • State management: Sessions

Chapter 5: Decision Making

  • The full if statement
  • The elseif clause
  • In-line conditional operator
  • PHP logical operators
  • PHP comparison operators
  • The switch-case statement
  • The while loop
  • The do-while loop
  • The for loop
  • Iterating through an indexed array
  • The foreach loop
  • Iterating through an associative array
  • The break statement
  • The continue statement
  • The die (or exit) construct

Chapter 6: String Handling

  • Strings are like arrays?
  • String-related functions
  • String handling: strlen
  • String formatting: printf
  • String handling: substr
  • String manipulation: str_replace
  • Comparison operators (reminder)
  • Comparing strings
  • Regular Expressions in PHP
  • PHP Regular Expressions functions
  • PHP Regular Expression patterns
  • Finding strings: pereg_match
  • Replacing strings: pereg_replace
  • Grouping and back-references
  • Splitting strings: pereg_split

Chapter 7: Writing Functions

  • User-defined functions
  • Function parameters
  • Assigning default values to parameters
  • Returning values from a function
  • PHP code from external files
  • Variable scope
  • Superglobal and Global scope
  • Local scope
  • Static scope
  • Error handling in PHP
  • Routing error messages
  • Specifying which errors to report
  • Setting error reporting using php.ini
  • Doing your own error handling

Chapter 8: Introducing MySQL

  • What is MySQL?
  • MySQL versions
  • MySQL GUI tools
  • MySQL administrator
  • MySQL variables and options
  • MySQL Query Browser
  • MySQL command line tool: mysql
  • Executing SQL from a file
  • Creating databases and tables
  • Using keys
  • Table types in MySQL
  • Basic SQL types
  • Other SQL types
  • Date and time types
  • Deleting databases and tables
  • Inserting data
  • Retrieving data
  • Updating and deleting data
  • MySQL user access control
  • MySQL user accounts
  • Assigning privileges
  • Concurrency control
  • Locking
  • Transaction control with InnoDB
  • MySQL documentation

Chapter 9: Integrating PHP and MySQL

  • PHP interfaces with MySQL
  • Connecting to MySQL
  • Connecting to a database
  • Executing SQL
  • Retrieving the data set
  • Refining the fetch
  • Other mysql functions
  • MySQL Improved Extension
  • MySQLi functions
  • MySQLi placeholders
  • MySQLi statement functions

Chapter 10: Security Overview

  • Basics of web security
  • Vulnerabilities of web applications
  • Vulnerabilities of authentication
  • Password security
  • SQL injection
  • Avoiding SQL injection
  • Query string injection
  • Cross-site scripting (XSS)
  • Avoiding XSS
  • Cookie vulnerability
  • Hidden field vulnerability
  • Sniffing attacks
  • Replay attacks
  • More information

Training provider

Teaching mode: Classroom - Instructor Led
Duration: 3 days
Gooroo has partnered with the global leaders in IT training to give you access to quality training, personalised to you, targeted at increasing your job opportunities and salary.

Our pricing

We do not display pricing as Gooroo members qualify for special discounts not available elsewhere. You must enquire through Gooroo to get this benefit.

New courses are happening all the time

Our partner's expert training consultant will provide you with the times and all the details you need. Enquire today.

Top skills covered in this course

This skill has an average salary of
and is mentioned in
of job ads.
This skill has an average salary of
and is mentioned in
of job ads.
Web application
This skill has an average salary of
and is mentioned in
of job ads.
This skill has an average salary of
and is mentioned in
of job ads.