Easy Tutorial
❮ Func String Strripos Func Mysqli Data Seek ❯

Introduction to PHP & MySQL


With PHP, you can connect to and manipulate databases.

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

To learn more about MySQL, you can check out our MySQL Tutorial.


What is MySQL?

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

Databases are very useful for organizing information in categories. A company's database might include the following tables:


PHP + MySQL


Queries

A query is a question or request for information.

With MySQL, we can query the database for specific information and get a record set returned.

Here is a query example (using standard SQL):

mysql> set names utf8;
mysql> SELECT name FROM websites;
+---------------+
| name          |
+---------------+
| Google        |
| Taobao        |
| tutorialpro.org|
| Weibo         |
| Facebook      |
| stackoverflow |
+---------------+
6 rows in set (0.00 sec)

The statement set names utf8; is used to set the database encoding, allowing Chinese characters to display correctly.

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

To learn more about SQL, visit our SQL Tutorial.


Downloading MySQL Database

If your PHP server does not have the MySQL database, you can download it 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 for this reason, many people believe that MySQL can only handle small to medium-sized systems.

In fact, for websites that support massive amounts of data and traffic (like Friendster, Yahoo, and Google), MySQL is the de facto standard database.

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

❮ Func String Strripos Func Mysqli Data Seek ❯