Book Image

Building a Web Application with PHP and MariaDB: A Reference Guide

By : Sai S Sriparasa
Book Image

Building a Web Application with PHP and MariaDB: A Reference Guide

By: Sai S Sriparasa

Overview of this book

Table of Contents (17 chapters)
Building a Web Application with PHP and MariaDB: A Reference Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Working with MariaDB


So far we have worked with core programming concepts of PHP and we have also worked with the MariaDB database server in Chapter 1, CRUD Operations, Sorting, Filtering, and Joins and Chapter 2, Advanced Programming with MariaDB. In this section, let us focus on setting up communication between PHP and MariaDB. PHP provides three APIs to connect to MariaDB; they are as follows:

API

Description

Comment

mysql

This is probably the most used API to connect to MySQL and MariaDB databases. This API has been around since PHP 2.0. Active development for this API has been stopped and it is not advised to use this API in any of new projects.

The mysql API has been deprecated since PHP 5.5.0 and will be removed in the future.

mysqli

MySQL Improved is the new API that has been introduced with PHP 5. This API is a huge upgrade over the last API. This API supports features such as client-side and server-side prepared statements, stored procedures, and transactions. This API...