PHP MySQL Introduction


With PHP, you can connect to and manipulate databases.

MySQL is the most popular open-source database system used with PHP.

If you want to learn more about MySQL, you can check out this site.MySQL Tutorial。


What is MySQL?

  • MySQL is a database system used on the Web.
  • MySQL is a database system that runs on a server.
  • MySQL is ideal for both small and large applications.
  • MySQL is very fast, reliable, and easy to use.
  • MySQL supports standard SQL.
  • MySQL compiles on a number of platforms.
  • MySQL is free to download and use.
  • MySQL is developed, distributed, and supported by Oracle Corporation.
  • MySQL is named after company founder Monty Widenius's daughter: My.

Data in MySQL is stored in tables. A table is a collection of related data, and it contains columns and rows.

Databases are useful when storing information in categories. A company's database may have the following tables:

  • Employees
  • Products
  • Customers
  • Orders

PHP + MySQL

  • PHP combined with MySQL is cross-platform. (You can develop on Windows and apply on Unix platforms.)

Query

A query is a question or a request.

With MySQL, we can query the database for specific information and get back a recordset.

Take a look at the following query (using standard SQL):

mysql> set names utf8;
mysql> SELECT name FROM websites;
+---------------+
| name          |
+---------------+
| Google        |
| 淘宝        |
| Example  |
| 微博        |
| Facebook      |
| stackoverflow |
+---------------+
6 rows in set (0.00 sec)

Statementset names utf8;It is used to set the database encoding so that Chinese can be displayed normally.

The above query selects all data from the "name" column in the "websites" table.

To learn more about SQL, please visit ourSQL Tutorial。


Download MySQL Database

If your PHP server does not have a MySQL database, you can download MySQL for free here: http://www.mysql.com。


Facts About MySQL Database

One great feature of MySQL is that it can be scaled down to support embedded database applications. Perhaps because of this, many people believe that MySQL can only handle small and medium-sized systems.

In fact, MySQL is the de facto standard database for websites that support huge data and traffic (such as Friendster, Yahoo, Google).

This address provides an overview of companies using MySQL: http://www.mysql.com/customers/。

Other Extensions