We are open! Classes are running in-person (socially distanced) and live online. Secure your seat today

PHP & MySQL Book

Step-by-Step Training Workbook Build Dynamic Sites with Back-End Functionality

This book will introduce you to the basics of PHP and MySQL. It starts from the ground up, building a solid foundation of how PHP works, thus allowing you to tackle your own projects and applications. It shows you how to work with forms, sanitize user input for security, send emails, work with cookies to collect information on your users and upload files. You’ll also learn how to interact with databases using SQL to fetch, insert, update, delete, and search records, and how to administer databases with phpMyAdmin.

Includes Downloadable Class Files (works on Mac & PC)
ISBN: 978-1-934624-92-0

Download Sample Exercise
Setup & Introduction
Downloading the Class Files
Before You Begin
  • Supported browsers
  • Recommended software
Mac: Setting Up the Local Server
  • Differences between MAMP and MAMP PRO
  • Installing MAMP PRO
  • Installing MAMP
  • ,
Windows: Setting Up the Local Server
  • Windows: Installing XAMPP
Section 1
Setting Up: Do This Before Other Exercises!
  • Setting up your class files
  • Setting MAMP PRO to display errors
Basic PHP Syntax
  • Echo, strings, and variables
  • Single quotes vs. double quotes
  • Escaping characters
  • Heredoc
  • Concatenation
  • Comments
Working with Numbers
  • Arithmetic operators
  • Assignment operators
  • Table of arithmetic operators
  • Table of assignment operators
  • If/Else
  • Elseif
  • Switch
  • Comparison operators
  • Logical operators
  • The difference between == and ===
Section 2
  • Creating a simple array
  • Using array()
  • Multidimensional arrays
  • Printing an entire array using print_r()
  • While Loops
  • Do…While
  • For Loops
  • ForEach
  • Break out of loop
  • Continue
Working with Strings
  • Comparing strings
  • Converting to upper and lower case
  • Searching through strings
  • Case-sensitive and case-insensitive
Section 3
Form Basics and Security
  • Post vs. get
  • Radios, checkboxes, and select fields
  • Magic quotes
  • Securing the page
  • Using functions
Sending Email
  • Setting up MAMP Pro
  • Setting up XAMPP and Mercury Mail
  • Sending a test email
Simple Form Validation and Email
  • Sanitizing input
  • Error checking
  • Displaying errors
  • Sending email
  • Adding a thank you page
  • Including files
Section 4
  • Adding cookies
  • Tracking the number of visits
  • Sending an email with the cookie info
  • Starting a session
  • Using session variables
  • Log in/log out
  • Destroying session variables
File Uploads
  • Making a file upload form
  • The $_FILES array
  • Uploading files
  • Basic security
Section 5
Creating a Database/MySQL/SELECT
  • Creating a new database
  • Connecting to the database
  • SQL basics
  • The SELECT statement
  • Display the number of rows returned
  • Making a reusable connection script
  • MySQL vs. MySQLi vs. PDO
Making a Reusable Connection Script
  • Error checking
  • Making an include
  • Sorting results
Prepared Statements
  • Selecting and filtering results
  • Preventing SQL injection attacks with prepared statements
Section 6
SQL: Insert
  • The INSERT statement
  • Using phpMyAdmin
  • Inserting information from a form
SQL: Update
  • The UPDATE statement
  • Update form
  • Display data in the update form
  • Display checkboxes
  • Hidden fields
SQL: Delete
  • The DELETE statement
  • Deleting rows from a database
  • Passing ID variables in a url
SQL: Search
  • Wildcard searches
  • Searching with a form
Reference Material

How our eBooks Work Buying eBooks for Someone Else

Features of Noble Desktop eBooks
  • Searchable, with live text that you can copy and paste.
  • Printable.
  • eBook graphics are in color (printed books are black and white).
  • Widely compatible: We provide the most common eBook formats (EPUB, MOBI, & PDF) so you can load them onto the device or app you choose; such as Mac, PC, iPhone, iPad, Kindle, Android, and more.
  • Free updates for the edition you buy. When we make major changes to a book (requiring a new edition), an affordable upgrade option will be available.
  • DRM-free: Files are subtly watermarked with your name and email, but we do not restrict the devices or apps you can use to view our eBooks.
  • Lifetime access to downloads from free your Noble Desktop account.
The Best Way to Enjoy Our Books

Our workbooks are meant to be used while you work on your computer. They typically contain step-by-step exercises that walk you through doing tasks on your computer. An ideal setup would be to have the eBook loaded onto a device (like a tablet/smartphone) or on a second computer monitor, so you can read the book as you work on your computer. You can also print the PDF if you prefer.

Which File Format Is Right for You?
  • Ideal for printing.
  • An exact match to the printed book. If the text reflow of an EPUB or MOBI file is confusing please refer to the PDF.
  • PDF is compatible with most devices, but it’s not optimized for small screens. If using a smaller screen you’ll likely want to use the EPUB or MOBI files.
  • The industry standard eBook format which works with all devices, except for the Amazon Kindle. EPUB can be read on Mac, PC, iPhone, iPad, iPod Touch, Nook, Sony Reader, Kobo, Android, and many more.
  • Ideal for smaller screens as the layout reflows to fit the current device (at the type size of your choice).
MOBI (Kindle)
  • Amazon’s format for Kindle devices and Kindle app.
  • Ideal for smaller screens as the layout reflows to fit the current device (at the type size of your choice).
  • Using an iOS Device such as iPhone & iPad? The Kindle app for Apple iOS devices requires a specialized format which we do not support. While our MOBI will work in the Kindle app, it will not render well on iOS devices. We recommend using the EPUB format with Apple’s Books app if reading on an iOS device.
Recommended Reading Apps
iPhone, iPad
  • Books (EPUB)
Windows PC
Can You Share the eBook or Printouts?

Noble Desktop books are intended for use by you, the owner. They are not intended to be loaned or given to others. The files are subtly watermarked with your name and email, but we do not apply any DRM. You can copy your eBooks to any of your own devices without restriction. You can print the PDF files for your own use, but not to give to others. You cannot sell used eBooks. Ownership is solely yours and cannot be transferred to someone else.

Teachers and training centers wishing to print copies for students should email hello@nobledesktop.com for licensing options and pricing.

Buying an eBook for Someone Else
  • When you buy an eBook for yourself, it will be added into your account. It will be watermarked with your information and is intended for use only by you.
  • You can purchase eBooks for someone else, such as a friend or colleague. Schools and training centers can purchase eBooks for their students (be sure to apply for bulk order discounts).
  • When buying eBooks for someone else, you will receive an eBook voucher code. Send that code to the recipient and they can redeem it. An eBook voucher code can be redeemed once, for the specific book you purchase for them.
  • The recipient of the eBook voucher code will need to log into their Noble Desktop account, or create a free account. In their account they will enter the code on their My eBooks page and the eBook will be added immediately into their account.
  • The recipient receives all the same benefits of Noble Desktop eBooks, which includes lifetime access to download their eBook, as well as free updates to that edition. When the next edition is released, an affordable upgrade option will be available to them.

Examples of What You Learn

Why Our Books Are Unique

Our books are packed with step-by-step exercises that walk you through projects. You’ll learn by doing exercises, not reading long explanations. The goal is to give you hands-on practice with the program, getting you started quickly with the things that are most important for real life work.

demonstration of different book formats: print, kindle, & mobile devices

Buy the workbook

Print book shipments are delayed by approximately one week due to coronavirus. There are no delays for ebooks.

We offer bulk order discounts

This book comes free with our PHP & MySQL Bootcamp class

Yelp Facebook LinkedIn YouTube Twitter Instagram