search
Homephp教程php手册通过PHP连接MySQL的两种方法简介

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

Jun 13, 2016 am 10:06 AM
mysqlphpweboneandWaymethodofIntroductionconnectpass

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 伺服器长期连线。

Statement
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.