PHP MySQL Introduction
Through 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'sMySQL 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 an ideal choice for both small and large applications.
- MySQL is very fast, reliable, and easy to use.
- MySQL supports standard SQL.
- MySQL is compiled on some platforms.
- MySQL is free to download and use.
- MySQL is developed, released, and supported by Oracle Corporation.
- MySQL is named after the daughter of the company's founder, Monty Widenius: My.
Data in MySQL is stored in tables. A table is a collection of related data, containing columns and rows.
Databases are very useful when storing information in categories. A company's database may have the following tables:
- Employees
- Products
- Customers
- Orders
PHP + MySQL
- The combination of PHP and MySQL is cross-platform. (You can develop on Windows and deploy on Unix platforms.)
Query
A query is an inquiry or request.
Through MySQL, we can query specific information from the database and get back a result set.
Look at the query below (using standard SQL):
mysql> set names utf8;
mysql> SELECT name FROM websites;
+---------------+
| name |
+---------------+
| Google |
| 淘宝 |
| Runoob Tutorial |
| 微博 |
| Facebook |
| stackoverflow |
+---------------+
6 rows in set (0.00 sec)
The statement **set names utf8;** is used to set the database encoding so that Chinese characters can be displayed normally.
The query above selects all data from the "name" column in the "websites" table.
To learn more about SQL, please visit our SQL 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 the 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 think MySQL can only handle small and medium-sized systems.
In fact, for those websites that support huge amounts of data and traffic (such as Friendster, Yahoo, Google), MySQL is the de facto standard database.
This address provides an overview of companies using MySQL:http://www.mysql.com/customers/.