Introduction
This chapter will explain some recipes where we will use a database along with PHP on the server side. A database is an essential part of almost every dynamic web application. PHP provides a large number of functions to interact with the database. The most commonly used database along with PHP is MySQL. In this chapter, we will be using another version of MySQL called MySQLi or MySQL improved. It provides significant advantages over the MySQL extension; most important of them being the support for the object-oriented interface as well as the procedural interface. Other features include support for transactions, prepared statements, and so on.
You can read more about MySQLi on the PHP site at http://www.php.net/manual/en/book.mysqli.php.
Tip
MySQLi extension is available with PHP version 5.0 or higher. So, make sure you have the required PHP version. If you are running PHP 5 or a higher version, you will have to configure MySQL separately as a default PHP support, for MySQL was...