- Murach’s PHP and MySQL
- College Instructors
- Jeff Salter, Developer, Sacramento, California
- Who this book is for
- What this book does
- Section 1: Get started fast with PHP and MySQL
- Section 2: Master PHP programming
- Section 3: Master MySQL programming
- Section 4: Advanced skills for building websites
- Why you’ll learn faster and better with this book
- What software you need
- Apache, MySQL, and PHP
- A text editor for PHP code
- One or more browsers
- Optional: An Integrated Development Environment
- See the appendixes for help on installing these items
- Three companion books
- Murach’s MySQL (Second Edition)
- Murach’s HTML5 and CSS3 (Third Edition)
- Murach’s JavaScript and jQuery
- What people say about this book
Murach’s PHP and MySQL
PHP and MySQL are two of today’s most popular, open-source tools for server-side web programming. And with this book, you’ll learn right from the start how to use them together, the way the pros do. In fact, you’ll create a database-driven website that implements the MVC pattern in the first 6 chapters! Then, the rest of the chapters show you how to build out your PHP and MySQL skills to the professional level.
College Instructors
Go to our instructor’s site to learn more about the latest edition of this book and its instructor’s materials.
Along with the great organization, ease of learning, and thorough coverage of the technologies and programming practices, this book is simply a pleasure to read. Any developer/techie/geek should enjoy it. A solid 5-star rating all the way.»
Jeff Salter, Developer, Sacramento, California
- About this Book
- Table of Contents
- FREE Downloads
- Book FAQs
- Corrections
- Reviews
Who this book is for
This book is for anyone who wants to learn how to build and maintain websites that use PHP and MySQL. If you have some programming experience, you’ll move through this book more quickly. But because of its self-paced approach, this book also works for beginning programmers.
The only prerequisite for this book is that you have some elementary HTML and CSS skills. If you don’t have these skills or if you want to add to your skill set, you can read Murach’s HTML5 and CSS3.
What this book does
This book gets you started with PHP and MySQL as quickly as possible and then builds out your 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.
Section 1: Get started fast with PHP and MySQL
This section is designed to get you off to a fast start whether or not you have any programming experience. So chapter 2 presents a complete subset of PHP; chapter 3 shows you how to use a MySQL database; chapter 4 shows you how to develop database applications with PHP; chapter 5 shows how to structure the code in your applications by using the MVC pattern; and chapter 6 shows you how to test and debug your web applications.
This section uses a self-paced approach that lets experienced programmers move more quickly and beginners work at a pace that’s comfortable for absorbing all of the new information. Then, when you finish this section, you’ll understand how all the pieces of a web application fit together, and you’ll be ready for rapid progress in the sections that follow. Most important, you’ll actually be able to build database-driven web applications of your own!
Section 2: Master PHP programming
In this section, you’ll expand your PHP skills to include the professional skills you’ll need on the job every day. That means you’ll soon be coding applications that use arrays, functions, regular expressions, exception handling, libraries, your own objects…and more! The last application in this section illustrates an object-oriented approach to data validation that you can use as a model for data validation in your own applications.
Section 3: Master MySQL programming
In this section, you’ll expand your MySQL and PHP skills to include the skills you need for building full-fledged database-driven web applications. That includes:
- how to design a database
- how to use SQL DDL statements to create a database
- how to use SQL DML statements to extract and update the data in a database
- the advanced PHP skills that you need for developing database applications
Section 4: Advanced skills for building websites
The last section in this book rounds out your web development skills by showing you how to:
- secure a website
- send email and access other websites
- work with files, uploads, and images
These are the skills you need to ensure that your web applications come across as trustworthy, reliable, and fully professional to your visitors. Then, the last chapter in this section shows how to put all your skills together in an e-commerce website.
Why you’ll learn faster and better with this book
Like all our books, this one has features that you won’t find in competing books. That’s why we believe you’ll learn faster and better with our book than with any other. Here are just a few of those features.
- Because section 1 presents a complete subset of PHP and MySQL in just 6 chapters and 204 pages, you’re ready for productive work much faster than you are when you use competing books.
- Because the next three sections present all of the other skills that you need for developing web applications at a professional level, you can go from beginner to professional in a single book.
- The exercises at the end of each chapter let you practice what you’ve just learned. However, to make sure you get the most practice in the least time, these exercises start from applications that you can download from our website. This download also includes the solutions to the exercises so you can compare your solutions with the model solutions.
- To show you how all of the pieces of a PHP and MySQL application work together, this book presents the HTML, PHP, and MySQL code for 16 applications. As we see it, the only way to master PHP programming is to study the code in applications like these. but this is a missing ingredient in other books.
What software you need
Apache, MySQL, and PHP
To run web applications that use PHP and MySQL, you need:
All three of these can be downloaded and installed for free in a single download called XAMPP.
A text editor for PHP code
To edit your PHP code, you can use any text editor that you like. However, a text editor that includes syntax coloring and auto-formatting will help you develop applications more quickly and with fewer errors. That’s why we recommend:
Both are available for free, and both can be used for entering and editing HTML, CSS, and PHP code.
One or more browsers
To test any web application, you need multiple web browsers. To start, you can use the browser that comes with your computer: Internet Explorer for Windows systems and Safari for Macs. But we also recommend that you test your applications using Google Chrome and Mozilla Firefox, and both are available for free.
Optional: An Integrated Development Environment
If you would like to use an Integrated Development Environment for PHP programming, we recommend the NetBeans IDE. It includes a text editor that lets you enter and edit code. It provides an easy way for you to run your applications. And it provides special tools that help you debug your applications.
See the appendixes for help on installing these items
To help you install these products, the appendixes provide the website addresses and procedures that you’ll need for both Windows and Mac OS systems. In addition, chapter 1 provides a quick guide to using Notepad++ and NetBeans.
Three companion books
Murach’s MySQL (Second Edition)
Murach’s MySQL is the perfect companion book to our PHP book. This book expands on the MySQL material in our PHP book. It goes into more depth on subjects like querying, with more options and more examples. It goes into more breadth by covering new subjects, like how to use stored programs and do database administration tasks. And it’s the perfect MySQL desk reference.
Murach’s HTML5 and CSS3 (Third Edition)
Murach’s HTML5 and CSS3 is another book that every PHP developer should have. It will help you expand your HTML and CSS skills in a professional way whenever you have some extra time. It covers today’s best practices for using HTML5 and CSS3. And it’s the best on-the-job reference available for HTML and CSS.
Murach’s JavaScript and jQuery
Murach’s JavaScript and jQuery is a third book that every PHP developer should have. It teaches you how to write client-side code for your web pages to enhance the user experience. And it is another great on-the-job reference.
What people say about this book
«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
«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. Any developer/techie/geek should enjoy it. A solid 5-star rating all the way.»
— Jeff Salter, Developer, Sacramento, California
«As a C# developer, I needed a book that would clear up the sometimes confusing syntax of PHP without requiring me to wade through a lot of concepts I already understood. This book does exactly that. 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.»
— 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, JavaScript, and C++ books so I can learn even more about those languages.»
— Posted at an online bookseller
«Without a doubt, this book qualifies itself as a very practical book on learning PHP in the shortest time. I would thoroughly recommend this book to all budding PHP web developers out there, including ASP.NET developers who wish to diversify into PHP.»
— Jason Ong, ASPNET World
«Murach books are always excellent. When I started working with PHP, I was hoping they would release a PHP book. I am thrilled with this book…. It is an excellent learning book, as it walks through all features, but it also is an excellent reference book for advanced programmers. I highly recommend this for PHP and MySQL programming.»
— Posted at an online bookseller
«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. It effectively compresses the key amounts of information required to understand PHP programming and competently execute a solid PHP application from scratch.»
— Mike Riley, Dr. Dobb’s Online
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.