当前位置: 首页 > 网络学院 > 服务端脚本教程 > PHP > MySQL 介绍

PHP
WINDOWS下安装MySQL
PHP 制作 网站/服务器 监视脚本
用PHP和CSS制作活动按钮
PHP 单件模式
PHP MVC模式,类封装以及HACK
PHP 中使用正则表达式
PHP 防止 SQL 注入攻击
PHP 跨站点脚本攻击
PHP 防止用户操纵 GET 变量
PHP 防止远程表单提交

PHP 中的 MySQL 介绍


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-01   浏览: 878 ::
收藏到网摘: n/a

MySQL is the most popular open source database server.
MySQL是当今最流行的“开放式源数据库服务器”(open source database server)。


What is MySQL
到底什么是MySQL呢?

MySQL is a database. A database defines a structure for storing information.
首先,MySQL是一个用来存储数据的数据库;其次,它为存储的信息定义了一个结构及框架。

In a database, there are tables. Just like HTML tables, database tables contain rows, columns, and cells.
在数据中,所有的信息都是以表格的形式存在的,这就像HTML中的表格;数据库包含行、列和单元格。

Databases are useful when storing information categorically. A company may have a database with the following tables: "Employees", "Products", "Customers" and "Orders".
如果你希望把信息按类别进行存储,那么数据库的优势就很明显了。这里说的类别就像一个公司的数据库一样,其中可能包含“职工”、“产品”、“客户”以及“订单”这样的类别。


Database Tables
数据库表(Database Tables)

A database most often contains one or more tables. Each table has a name (e.g. "Customers" or "Orders"). Each table contains records (rows) with data.
一个数据库通常包含一张或多张数据库表。每张表都有一个名字(比如:“Product”、“Order”);每张表都包含数据记录[data record](也可以称作数据行[data row])。

Below is an example of a table called "Persons":
下面是一张名为“Persons”的表:

LastName FirstName Address City
Hansen Ola Timoteivn 10 Sandnes
Svendson Tove Borgvn 23 Sandnes
Pettersen Kari Storgt 20 Stavanger

The table above contains three records (one for each person) and four columns (LastName, FirstName, Address, and City).
上述表中包含三条记录(每条记录都包含一个人所用的信息),以及四个纵列(LastName, FirstName, Address, City)。


Queries
查询语句(Queries)

A query is a question or a request.
查询语句就是对数据库提出一个询问或请求。

With MySQL, we can query a database for specific information and have a recordset returned.
在MySQL数据库里,我们可以从数据库中查询指定的信息并返回一条记录。

Look at the following query:
看看下面这个关于查询语句的例子:

SELECT LastName FROM Persons

The query above selects all the data in the LastName column in the Persons table, and will return a recordset like this:
上述查询语句要求选择Persons表中所有LastName纵列的数据。通过上述语句,我们可以得到下面的结果。

LastName
Hansen
Svendson
Pettersen


Download MySQL Database
下载MySQL数据库

If you don't have a PHP server with a MySQL Database, you can download MySQL for free here: http://www.mysql.com/downloads/index.html
如果你的PHP服务器中没有安装MySQL数据库,那么你可以在这个地方下载:http://www.mysql.com/downloads/index.html

评论 (4) 1 All

登陆 | 还没注册?