How to create a MySQL connection?

MySQL

How to create a MySQL connection? Before going ahead We’ll look an overview of MySQL. MySQL is an open-source relational database management system. It is very powerful database management system. MySQL has 3  main API options when considering connecting to a MySQL database server:

  • PHP’s MySQL Extension
  • PHP’s MySQLi Extension
  • PHP Data Objects (PDO)

Today in this article I’ll show you how you can create a MySQL connection in 3 different APIs.


MySQL connection in PDO

PDO is an acronym for PHP Data Objects. PDO is a lean, consistent way to access databases.

MySQLi Object-Oriented connection

MySQLi is an acronym for MySQL Improved.

MySQLi Procedural connection

Leave a Reply