Whats New in This Edition?
The code and instructions in the first edition of this book (written in 2012) were made obsolete by new and very different versions of XAMPP, EasyPHP, phpMyAdmin, PHP, and MySQL/MariaDB. This second edition contains new code and instructions to match the latest versions of the software.
With the massive increase in cybercrime and other cyber threats, this new edition has been fortified with a much stronger emphasis on security. This book takes the approach of sanitizing any data that has been accepted from any outside source and, additionally, sanitizing any data before it is displayed on a web page. Most of the examples use prepared statements that ensure that any externally accepted data cannot be executed and therefore cannot cause security vulnerabilities.
We have chosen Bootstrap to provide responsive web design (RWD) for each of the books example websites. While Bootstrap provides the CSS and JavaScript to format the examples in this book for any size device, you can easily reformat these examples with your own CSS code if you desire.
This new edition also takes a brief look at Oracles MySQL 8. A comparison is provided of the tools available in each version. Step-by-step procedures provide you with the ability to upgrade to MySQL 8.
The Teaching Method
This book uses a different way of teaching website database design compared with the majority of manuals. The usual layout starts with several lessons on PHP followed by snippets of code and may eventually conclude with a project or two. This book abandons that approach. The primary focus is on fully worked, practical MySQL/MariaDB database projects built into real-world web pages.
Instead of presenting PHP, SQL, and MySQL/MariaDB as completely separate topics, they are explained in the context of each project. However, you will find a useful quick reference of PHP syntax in Appendix B.
In this book, practical databases and interactive web pages are presented as early as possible; in fact, you will create a database and a table in the first chapter. In the second chapter, you will embed a database into an interactive web page and test it. Each subsequent chapter will introduce you to increasingly sophisticated and useful database-driven website pages.
We assume that you have little or no knowledge of PHP and databases. This book will demonstrate:
How to create a free environment for testing database-driven web pages.
How to embed PHP and interactive databases into real-world web pages. This is the primary theme throughout the book.
How PHP, HTML, and MySQL/MariaDB work together for creating and maintaining a database and its data.
How to create a user-friendly interface so that an administrator with minimum computer skills can monitor the database.
Because databases need to be viewed and tested on a server, the first part of Chapter has instructions for using a free server that can be downloaded and installed on your computer. This ensures you will have a safe development platform for learning and testing as you explore the books practical projects.
Starting with a separate study of PHP theory and syntax can deter learners and prolong the time until they get their hands on a practical application. Learners are enthused when they achieve something. This book jumps into the database driving seat right from the beginning. Essential PHP and MySQL/MariaDB techniques are presented in context within each tutorial where they are most relevant.
Who Is This Book For?
The book assumes you are thoroughly familiar with HTML5 and CSS3. However, we assume you have no knowledge of MySQL/MariaDB, PHP, and phpMyAdmin. As the chapters unfold, you will progress from intermediate level to advanced level.
You do not need to acquire an extensive knowledge of PHP to create interactive databases. We introduce all the PHP you will need in the appropriate place within each project. Each piece of PHP code is explained fully in plain English. The step-by-step, fully worked examples will show you what MySQL/MariaDB and PHP can do and how to do it. This book is for web designers who want to begin developing database-driven websites.
With this in mind, this book uses a highly motivational step-by-step approach. We recognize fully that a sense of achievement encourages readers to look forward eagerly to the next step. The book will teach enough PHP and MySQL/MariaDB to complete all the projects in the book. Web developers who have not kept up-to-date with MySQL/MariaDB and PHP will also benefit from this approach. College and university programming instructors will find that this book provides an excellent text, and the projects can form a basis for students to adapt for their course work.