PHP MYSQL Database

PHP MySQL Database

MySQL is one of the popular relational database systems. With PHP, we can connect and manipulate MySQL databases.

MySQL Database With PHP

In this article, we will learn about the PHP MySQL database. PHP supports mostly all databases, like Oracle, MySQL, MariaDB, MongoDB, etc. Most commonly used is the freely available MySQL database.

MySQL is a relational database management system that uses structured query language (SQL). There is a more advanced MySQL enterprise edition available for tech giant companies. PHP and MySQL combine many options to create any website; from small to large corporate portals.

What is MySQL?

  • MySQL is a popular relational database system.
  • It is available free-of-cost & is easy to install.
  • MySQL database server offers several advantages.
  • It is easy to use, extremely powerful, secure & scalable.
  • MySQL runs on various operating systems, including UNIX or LINX, Microsoft windows, apple MAC OSX and others.
  • It supports SQL (standard query language).
  • MySQL database is an ideal solution for small and large applications.
  • It includes data security that protects sensitive data from the attacker.

How to Download MySQL Database

We can download MySQL for free from its official website.

http://www.mysql.com

MySQL Database Table

MySQL database stores data into tables. A table is a set of data elements consisting of vertical columns and horizontal rows. Each row represents a data record in a table that is connected.

Example

The structure of a MySQL table that contains a person’s general information may look like the one shown below.

Id Firstname Lastname Email
1 Suman Malukani s@example.com
2 Riya Shah riya@example.com
3 Helly Ahuja helly@example.com
4 Rita Kapoor rita@example.com
5 John Potter john@example.com
6 Rahul Sharma rahul@example.com

It consists of various fields such as Id, Firstname, Lastname, Email, etc.

Database With SQL

SQL stands for the structured query language. It is a simple language for communicating with databases like MySQL.

With SQL, we can perform any database-related tasks such as creating database & tables, deleting & updating data records, sending a query to a database for specific records, etc.

Read Also: Top 25 MySQL Interview Questions and Answers for Experienced (Free PDF Download)

Database Queries

Queries are simply questions against a set of data. A database query is a request for data from a database. The request is to retrieve data. We can manipulate data using queries. The data come from different tables or even other queries.

Example

Select `email` from `person` where `Firstname` = "Suman"

If we execute the SQL query above, it will return the following record.

Output

s@example.com

Must Read: MySQLi Connect in PHP

Conclusion

MySQL is a relational database with SQL support for operations. Also, PHP provides strong support for the MySQL database. In the next article, we will learn about MySQL connections in PHP.

We hope you found this article helpful. Do refer to the PHP tutorial section to learn about the basics of PHP programming. Happy Learning!

Sahil Jani

Share
Published by
Sahil Jani

Recent Posts

5 Important Things To Know About WordPress Before You Use It

There is a reason big-name companies like CNN use WordPress. WordPress is a popular content…

3 years ago

How to Install MySQL on Your PC in 3 Easy Steps

In this tutorial, I'm going to show you how to install MySQL on your computer.…

4 years ago

Download and Install Turbo C++ for Windows 10 (Full Installation Guide)

Download Turbo C++ for windows 10 in just 7 Mb and run your first C++…

5 years ago

PHP .HTACCESS Redirects

We can redirect any webpage to any other or redirect the whole domain or website…

5 years ago

PHP Redirect Pages

There are lots of methods to redirect pages, like refresh-redirect from META tag, redirect from…

5 years ago

PHP Include & Required

Include files in PHP are used in appending various global or config files. We can…

5 years ago