PHP MySQL Database

The most often used database system with PHP is MySQL.


MySQL is a relational database management system that is free and open-source.

  • The MySQL database system has a number of advantages:
  • It is open-source and easy to install.
  • MySQL is compatible with UNIX or Linux, Microsoft Windows and other operating systems.
  • It is fast, secure and scalable.
  • MySQL is a great choice for both small and large projects.
  • MySQL has data security layers in place to keep sensitive data safe from hackers.
  • Oracle Corporation creates, distributes, and supports MySQL.

Like other relational databases, MySQL stores data in tables. A table is a set of columns and rows that hold linked information.

Lets see and example of table:



Each row contains particular information related a specific id.

Database Queries

A database can be accessed for specific information and a recordset returned.

Lets Search name from the table Persons and it will fetch all names:

SELECT Name FROM Persons

Download MySQL

If you have installed xamp than mySQL is pre-installed in your PC with Xamp, else you can download mySQL from this link.