通过PHP连接MySQL的两种方法简介_PHP教程

WBOY
Release: 2016-07-13 17:03:46
Original
838 people have browsed it

mysql可通过两种方式通过PHP与web相连,一种通过php的mysql相关函数,另一种通过php的ODBC相关函数

相关函数如下:

MYSQL函数

mysql_affected_rows: 得到 MySQL 最后操作影响的列数目。

mysql_close: 关闭 MySQL 伺服器连线。

mysql_connect: 开启 MySQL 伺服器连线。

mysql_create_db: 建立一个 MySQL 新资料库。

mysql_data_seek: 移动内部传回指标。

mysql_db_query: 送查询字串 (query) 到 MySQL 资料库。

mysql_drop_db: 移除资料库。

mysql_errno: 传回错误讯息代码。

mysql_error: 传回错误讯息。

mysql_fetch_array: 传回阵列资料。

mysql_fetch_field: 取得栏位资讯。

mysql_fetch_lengths: 传回单列各栏资料最大长度。

mysql_fetch_object: 传回物件资料。

mysql_fetch_row: 传回单列的各栏位。

mysql_field_name: 传回指定栏位的名称。

mysql_field_seek: 设定指标到传回值的某栏位。

mysql_field_table: 获得目前栏位的资料表 (table) 名称。

mysql_field_type: 获得目前栏位的型态。

mysql_field_flags: 获得目前栏位的旗标。

mysql_field_len: 获得目前栏位的长度。

mysql_free_result: 释放传回占用记忆体。

mysql_insert_id: 传回最后一次使用 INSERT 指令的 ID。

mysql_list_fields: 列出指定资料表的栏位 (field)。

mysql_list_dbs: 列出 MySQL 伺服器可用的资料库 (database)。

mysql_list_tables: 列出指定资料库的资料表 (table)。

mysql_num_fields: 取得传回栏位的数目。

mysql_num_rows: 取得传回列的数目。

mysql_pconnect: 开启 MySQL 伺服器长期连线。

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/630944.htmlTechArticlemysql可通过两种方式通过PHP与web相连,一种通过php的mysql相关函数,另一种通过php的ODBC相关函数 相关函数如下: MYSQL函数 mysql_affected_rows:...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!