PDO stands for PHP Data Object and it's an extension that
provides an interface for communicating with many supported
popular database systems such as MySQL and Oracle, PostgreSQL and
SQLite, etc.
It's provided starting with PHP 5.1.
Since PDO abstracts away all the differences between various
database management systems, you only need to change the
information about your database in your code in order to change
the database system used in your PHP application.
Setting up PDO
PDO is added by default starting with PHP 5.1 but you need to set
the necessary database driver in the php.ini file:
extension=pdo.so extension=pdo_mysql.so
Creating a MySQL Database
Let's start by creating a MySQL using the mysql client. In your
terminal, run the following command: $ mysql -u root -p
Enter your MySQL database password when prompted.
Next, run the following SQL instruction to create a …
[Read more]