If you're looking for a career-oriented book to anchor your web programming curriculum, this is a great choice. It lets you teach your students how to build web applications as a first course in programming. But it also lets your students build out their PHP and MySQL skills to a professional level. As a result, it can be used for both beginning and advanced courses.
The Canvas course file contains all the objectives, quizzes, assignments, and slides that you need to run an effective course. It only takes a few clicks to import it into the Canvas LMS. Then, you can customize it for your course. Learn more.
Along with the great organization, ease of learning, and thorough coverage of the technologies and programming practice, this book is simply a pleasure to read. A solid 5-star rating all the way."
This book gets your students started with PHP and MySQL (or its drop-in replacement, MariaDB) as quickly as possible and then builds out their skills in a professional way. To present the whole array of PHP and MySQL skills in a manageable progression, this book is divided into four sections.
This section is designed to get your students off to a fast start whether or not they have any programming experience:
When your students finish this section, they will understand how all the pieces of a web application fit together. They will be able to build database-driven web applications of their own. And they’ll be ready for rapid progress in the sections that follow.
This section expands upon the PHP skills of section 1 with arrays, functions, cookies, sessions, regular expressions, exception handling, libraries, classes and objects…and much more! The last application in this section illustrates an object-oriented approach to data validation that can be used as a model for validating user input...and you won’t find anything like that in most competing books.
This section expands upon the MySQL skills of section 1 so your students can build full-fledged database-driven web applications. As a result, it covers:
The last section in this book rounds out the web development skills by showing how to:
These are the skills needed to ensure that web applications come across as trustworthy, reliable, and fully professional. Then, the last chapter in this section shows how to put everything together in an e-commerce web site.
Like all our books, this one has features that you won’t find in competing books. That’s why we believe you can teach your students faster and better with our book than with any other. Here are just a few of those features:
Because this book works for students with no programming experience, it can be used as a first course in programming. In that case, section 1 teaches your students how to use PHP and MySQL to develop a complete database application. That is an exciting accomplishment in just 6 chapters. Then, you can add to that skill set with selected chapters from sections 2, 3, and 4.
If your students have some programming experience, this book works great for a one- or two-term course in PHP and MySQL. Even then, you probably won’t be able to assign all of the chapters and exercises in the book or all of the exercises and projects in the instructor’s materials. But no matter how far you get, your students will be mastering skills at a professional level.
To run web applications that use PHP and MySQL, your students need:
All three of these can be downloaded and installed for free in a single download called XAMPP.
To edit PHP code, you can have your students use any text editor you choose.
However, we recommend using an IDE (Integrated Development Environment) such as NetBeans, like the professionals do. NetBeans includes a text editor that’s designed for working with HTML, CSS, and PHP. But beyond that, it provides features that make it easier for your students to run and debug their applications. That’s why chapter 1 presents a short introduction that shows how to use NetBeans for PHP development.
Having said that, if you prefer to use a standalone text editor, here are two we like:
Both are available for free and can be used for entering and editing HTML, CSS, and PHP code.
To test any web application, including PHP and MySQL applications, your students need one or more web browsers. For that, we recommend Google Chrome.
To help your students install these products, the appendixes provide the web site addresses and procedures that they will need for Windows and macOS systems.
"Compared to the stack of other PHP/MySQL titles on the market, I found Murach to be one of the easiest and fastest books to teach the subject."
- Mike Riley, Online Reviewer
“This book helps a lot because the explanations are detailed. I read the topics that I didn’t understand in class and when I did, I finally understood how it works.”
- Verified purchase at an online bookseller
“Great tutorials! Gotta have some real-world projects to be able to grasp the concepts, and this book delivers.”
- Verified purchase at an online bookseller
“The book is put together for the student rather than most books on the topic [that are written] from the teacher’s point of view. You learn php from the beginning, in very precise steps that are the building blocks, which eventually make sense of the whole PHP topic.
- Verified purchase at an online bookseller in the United Kingdom
"Murach’s unique style of putting explanations on each left page and corresponding examples on each right page is ingeniously simple yet amazingly effective. I frequently scan the sample page first and only read the explanation page when I need further clarification. However, the explanation page is always there if you need it. The result is a very fast read. Also, the editing is superb. So far, I haven’t encountered any errors in the sample source code. Excellent book."
- Verified purchase at an online bookseller
"Along with the great organization, ease of learning, and thorough coverage of the technologies and programming practice, this book is simply a pleasure to read. A solid 5-star rating all the way."
- Jeff Salter, Developer, California
"Awesome book. Murach’s PHP and MySQL reads like a learning book but is structured in a way that makes it an excellent reference manual. The left side explanation/right side code orientation took me a little time to warm up to but is actually a much more clean layout and works much better when you are referencing."
- Posted at an online bookseller
"This is my first Murach book and I love it so much, I now want to go and buy their CSS and JavaScript books so I can learn even more about those languages."
- Verified purchase at an online bookseller
"Truly a Beginner to Pro book. All the topics I needed to learn to get productive fast, and presented in a nice logical sequence. Definitely an A+++."
- Verified sale at an online bookseller
View the table of contents for this book in a PDF: Table of Contents (PDF)
Click on any chapter title to display or hide its content.
How a client-server architecture works
How static web pages are processed
How dynamic web pages are processed
A survey of web application software
Highlights in the history of PHP
Highlights in the history of MySQL
The user interface
The HTML file
The CSS file
The PHP file
How to edit a PHP page with a text editor
How to start and stop Apache and MySQL on your own computer
How to deploy a PHP application
How to run a PHP application
How to test and debug a PHP page
How to view the source code for a web page
How to work with PHP projects and files
How to edit and test a PHP application
How to import and configure a PHP project
How to embed PHP in HTML
How to code comments and statements
The six PHP data types
How to declare variables and constants
How to use the built-in $_GET array
How to use the built-in $_POST array
When to use the HTTP GET and POST methods
How to code string expressions
How to code echo statements
How to code numeric expressions
How to use the compound assignment operators
How to use some built-in functions
How to use the filter_input() function
The user interface
The form in the HTML file
The PHP file
How to code conditional expressions
How to code if statements
How to code while and for statements
How to pass control to another page
The user interface
The code for the indexphp file
The code for the display_resultsphp file
How to access the PHP manual
How to find the documentation you need
How a database table is organized
How the tables in a relational database are related
How the columns in a table are defined
How to select data from a single table
How to select data from multiple tables
How to insert, update, and delete data
What MySQL provides
Two ways to work with MySQL
How to start phpMyAdmin
How to log in, log out, and change your password
How to import and run a SQL script that creates a database
How to review the data and structure of a table
How to run SQL statements
How to create users with limited privileges
How to connect to a database
How to handle exceptions
How to execute SELECT statements
How to work with the first row of a result set
How to work with all the rows of a result set
How to execute INSERT, UPDATE, and DELETE statements
The user interface
The code
The user interface
The code
An introduction to the MVC pattern
How to code functions
How to redirect requests
How to use the Post-Redirect-Get pattern
The user interface
The model
The controller
The view
The user interface
The model
The controller
The view
Typical test phases for a PHP application
The three types of errors that can occur
Common PHP errors
An easy way to trace the execution of your PHP code
How to set and remove breakpoints
How to step through code
How to inspect variables
How to inspect the stack trace
How to get data from text boxes, password boxes, and hidden fields
How to get data from a radio button
How to get data from a check box
How to get data from an array of check boxes
How to get data from a drop-down list
How to get data from a list box
How to get data from a text area
How to format special characters
How to format line breaks
How to display data with echo and print statements
How to use the equality and identity operators
How to use the relational operators
How to use the logical operators
How to code if statements with else clauses
How to code if statements with else if clauses
How to use the conditional operator
How to use the null coalescing operators
How to code switch statements
How to code match expressions
How to use a switch statement in the controller
How to code while loops
How to code do-while loops
How to code for loops
How to use the break and continue statements
How to create strings
How to use escape sequences
How to work with string length and substrings
How to search a string
How to modify strings
How to convert strings to and from arrays
How to convert strings to and from ASCII values
How to compare strings
How to assign integers
How to assign floating-point values
How to use the math functions
How to generate random numbers
How to use the sprintf() function to format strings and numbers
How to convert strings to numbers
An introduction to timestamps
An introduction to DateTime objects
How to use the DateTime object
How to modify and validate a DateTime object
How to format a DateTime object
How to use the DateInterval and DateTime objects together
Examples of working with DateTime objects
How to create an array
How to add and delete elements
How to work with variable substitution
How to use for loops to work with arrays
How to create an associative array
How to add and delete elements
How to work with variable substitution
How to use foreach loops to work with arrays
How to work with the spread operator
How to fill, merge, slice, and splice arrays
How to check if a variable is an array
How to work with queues and stacks
How to get the sum and product of elements
How to search arrays
How to sort arrays
How to modify arrays
Understanding an array of arrays
How to create and use an array of arrays
The user interface
The code for the controller
The code for the view
An introduction to cookies
How to set and get a cookie
How to enable or disable cookies
Why session tracking is difficult with HTTP
How session tracking works in PHP
How to start a session
How to set and get session variables
How to manage a session
How to end a session
The user interface
The controller
The model
The Add Item view
The Cart view
How to create a function
How to call a function
How to pass arguments by value and by reference
How variable scope works
How to use optional parameters
How to use named arguments
How to work with type declarations
How to use variable-length parameter lists
A library of functions
How to set the include path
How function scope works
How to create and use namespaces
How to work with variable functions and callbacks
How to work with anonymous functions
How to work with arrow functions
How to work with closures
The user interface
The model
The controller
The view
The code for the Category class
The code for the Product class
How to code properties
How to code constructors and destructors
How to use constructor property promotion
How to code methods
How to create and use objects
How to code class constants
How to code static properties and methods
How to work with pure enums
How to work with backed enums
The user interface
The model
The controller
The view
How to loop through an object’s properties
How to clone and compare objects
How to inspect an object
How to inherit a class
How to use the protected access modifier
How to create abstract classes and methods
How to create final classes, methods, and constants
How to work with interfaces
How to create and use regular expressions
How to match characters
How to use the character class
How to create complex patterns
How to use look-ahead assertions
How to use a multiline regular expression
How to use a global regular expression
How to replace a regular expression with a string
How to split a string on a regular expression
Regular expressions for data validation
How to create and throw exceptions
How to catch exceptions
How to catch errors
The user interface
The file structure
The model
The controller
The view
A long version of the Registration application
The basic steps for designing a data structure
How to identify the data elements
How to subdivide the data elements
How to identify the tables and assign columns
How to identify the primary and foreign keys
How to enforce the relationships between tables
How normalization works
How to identify the columns to be indexed
The seven normal forms
How to apply the first normal form
How to apply the second normal form
How to apply the third normal form
When and how to denormalize a data structure
How to create a database
How to select a database
How to drop a database
An introduction to MySQL data types
How to create a table
How to code a primary key
How to code a foreign key constraint
How to alter a table
How to drop a table
How to create an index
How to drop an index
A summary of privileges
How to work with users
How to grant privileges
How to revoke privileges
How to view privileges
How to load data from text files
How to dump a database to a SQL script
How to select columns from a table
How to use an alias for a column
How to select rows with a LIMIT clause
How to select rows with a WHERE clause
How to use the logical operators
How to use the IS NULL operator
How to use the LIKE operator
How to sort rows with an ORDER BY clause
How to code an inner join
When and how to use table aliases
How to code aggregate functions
How to group queries by column
Where to use subqueries
How to code correlated subqueries
How to insert rows
How to update rows
How to delete rows
PDO (PHP Data Objects)
PHP’s mysqli extension
PHP’s MySQL extension
How to connect to a database
How to select data
How to insert, update, and delete data
How to work with prepared statements
How to set the error mode for PDO
A model in PDO
How to connect to a database
How to select data
How to insert, update, and delete data
How to work with prepared statements
The object-oriented style compared to the procedural style
A model in mysqli
A simple content management system
How to add HTML tags to text
The Home page
The directory structure
The utility files
The view files
The user interface
The controller
The view
The user interface
The controller
The view
An introduction to secure connections
How SSL authentication works
How to get a digital secure certificate
How to request a secure connection
How to redirect to a secure connection
Three types of authentication
How to store and validate a password
How to use form-based authentication
How to get a directory listing
How to read and write an entire file
How to read and write part of a file
How to copy, rename, and delete a file
HTML for uploading a file
PHP for working with an uploaded file
How to get information about an image
How to read and write images
How to resize an image
How to work with transparency
The user interface
The utility files
The controller
The view
Prototyping and stepwise refinement
The directory structure of the website
The Catalog application
The Cart application
The Checkout and Account applications
The My Account page
The Admin Login and Admin Menu pages
The Product Manager application
The Category Manager application
The Order Manager application
The Account Manager application
How to install the Chrome browser
How to install Notepad++
How to install XAMPP
How to set the default time zone for PHP
How to start and stop the Apache and MySQL servers
How to configure phpMyAdmin
How to install the source code for this book
How to create and restore the databases
How to install NetBeans
How to install Xdebug
How to install the Chrome browser
How to install Atom
How to install XAMPP
How to set the default time zone for PHP
How to start and stop the Apache and MySQL servers
How to configure phpMyAdmin
How to install the source code for this book
How to create and restore the databases
How to install NetBeans
How to install Xdebug
If you aren’t already familiar with the supporting courseware that we provide for a book, please go to About our Courseware. As you will see, our courseware consists of the end-of-chapter activities in the book, the files in the student download at our retail site, and the instructor’s materials. These components provide everything that other publishers provide in a way that delivers better results.
If you are familiar with our courseware, here’s a quick summary of the courseware for this book. For a detailed description in PDF format, please read the Instructor’s Summary .
In the book, appendix A (Windows) and appendix B (macOS) give your students complete instructions for downloading and installing these items on their own systems.
On this page, we’ll be posting answers to the questions that come up most often about this book. So if you have any questions that you haven’t found answered here at our site, please email us. Thanks!
To view the corrections for this book in a PDF, just click on this link: View the corrections
Then, if you find any other errors, please email us so we can correct them in the next printing of the book. Thank you!
This is our site for college instructors. To buy Murach books, please visit our retail site.