MySQL PHP API

摘要

本手册描述了MySQL可以使用的PHP扩展和接口。

有关法律信息,请参阅法律声明

有关使用MySQL的帮助,请访问MySQL论坛,在那里您可以与其他MySQL用户讨论您的问题。

文件生成日期:2021年4月01日(修订版本:69186)


表的内容

前言及法律公告
1 MySQL PHP API介绍
2 MySQL PHP驱动程序概述
2.1介绍
2.2术语的概述
2.3选择API接口
2.4选择图书馆
2.5概念
2.5.1缓冲查询和非缓冲查询
2.5.2字符集
MySQL改进扩展
3.1概述
3.2快速入门指南
3.2.1双重程序化和面向对象的接口
3.2.2连接
3.2.3执行语句
3.2.4准备好的语句
3.2.5存储过程
3.2.6多条语句
3.2.7对事务的API支持
3.2.8元数据
3.3安装/配置
3.3.1需求
3.3.2安装
3.3.3运行时配置
3.3.4资源类型
3.4 mysqli扩展和持久连接
3.5预定义常量
3.6笔记
3.7 MySQLi扩展功能简介
3.8 mysqli类
3.8.1mysqli: affected_rows美元mysqli_affected_rows
3.8.2mysqli:自动提交mysqli_autocommit
3.8.3mysqli: begin_transactionmysqli_begin_transaction
3.8.4mysqli: change_usermysqli_change_user
3.8.5mysqli: character_set_namemysqli_character_set_name
3.8.6mysqli:关闭mysqli_close
3.8.7mysqli:提交mysqli_commit
3.8.8mysqli: connect_errno美元mysqli_connect_errno
3.8.9mysqli: connect_error美元mysqli_connect_error
3.8.10mysqli: __constructmysqli:连接mysqli_connect
3.8.11mysqli:调试mysqli_debug
3.8.12mysqli: dump_debug_infomysqli_dump_debug_info
3.8.13mysqli: errno美元mysqli_errno
3.8.14mysqli: error_list美元mysqli_error_list
3.8.15mysqli:: $错误mysqli_error
3.8.16mysqli: field_count美元mysqli_field_count
3.8.17mysqli: get_charsetmysqli_get_charset
3.8.18mysqli: client_info美元mysqli: get_client_infomysqli_get_client_info
3.8.19mysqli: client_version美元mysqli_get_client_version
3.8.20mysqli: get_connection_statsmysqli_get_connection_stats
3.8.21mysqli: host_info美元mysqli_get_host_info
3.8.22mysqli: protocol_version美元mysqli_get_proto_info
3.8.23mysqli: server_info美元mysqli: get_server_infomysqli_get_server_info
3.8.24mysqli: server_version美元mysqli_get_server_version
3.8.25mysqli: get_warningsmysqli_get_warnings
3.8.26mysqli:: $ infomysqli_info
3.8.27mysqli:初始化mysqli_init
3.8.28mysqli: insert_id美元mysqli_insert_id
3.8.29mysqli:杀mysqli_kill
3.8.30mysqli: more_resultsmysqli_more_results
3.8.31mysqli: multi_querymysqli_multi_query
3.8.32mysqli: next_resultmysqli_next_result
3.8.33mysqli:选项mysqli_options
3.8.34mysqli:萍mysqli_ping
3.8.35mysqli:民意调查mysqli_poll
3.8.36mysqli:准备mysqli_prepare
3.8.37mysqli:查询mysqli_query
3.8.38mysqli: real_connectmysqli_real_connect
3.8.39mysqli: real_escape_stringmysqli_real_escape_string
3.8.40mysqli: real_querymysqli_real_query
3.8.41mysqli: reap_async_querymysqli_reap_async_query
3.8.42mysqli:刷新mysqli_refresh
3.8.43mysqli: release_savepointmysqli_release_savepoint
3.8.44mysqli:回滚mysqli_rollback
3.8.45mysqli:保存点mysqli_savepoint
3.8.46mysqli: select_dbmysqli_select_db
3.8.47mysqli: set_charsetmysqli_set_charset
3.8.48mysqli:: $ sqlstatemysqli_sqlstate
3.8.49mysqli: ssl_setmysqli_ssl_set
3.8.50mysqli:统计mysqli_stat
3.8.51mysqli: stmt_initmysqli_stmt_init
3.8.52mysqli: store_resultmysqli_store_result
3.8.53mysqli: thread_id美元mysqli_thread_id
3.8.54mysqli: thread_safemysqli_thread_safe
3.8.55mysqli: use_resultmysqli_use_result
3.8.56mysqli: warning_count美元mysqli_warning_count
3.9 mysqli_stmt类
3.9.1mysqli_stmt: affected_rows美元mysqli_stmt_affected_rows
3.9.2mysqli_stmt: attr_getmysqli_stmt_attr_get
3.9.3mysqli_stmt: attr_setmysqli_stmt_attr_set
3.9.4mysqli_stmt: bind_parammysqli_stmt_bind_param
3.9.5mysqli_stmt: bind_resultmysqli_stmt_bind_result
3.9.6mysqli_stmt:关闭mysqli_stmt_close
3.9.7mysqli_stmt: __construct
3.9.8mysqli_stmt: data_seekmysqli_stmt_data_seek
3.9.9mysqli_stmt: errno美元mysqli_stmt_errno
3.9.10mysqli_stmt: error_list美元mysqli_stmt_error_list
3.9.11mysqli_stmt:: $错误mysqli_stmt_error
3.9.12mysqli_stmt:执行mysqli_stmt_execute
3.9.13mysqli_stmt:取mysqli_stmt_fetch
3.9.14mysqli_stmt: field_count美元mysqli_stmt_field_count
3.9.15mysqli_stmt: free_resultmysqli_stmt_free_result
3.9.16mysqli_stmt: get_resultmysqli_stmt_get_result
3.9.17mysqli_stmt: get_warningsmysqli_stmt_get_warnings
3.9.18mysqli_stmt: insert_id美元mysqli_stmt_insert_id
3.9.19mysqli_stmt: more_resultsmysqli_stmt_more_results
3.9.20mysqli_stmt: next_resultmysqli_stmt_next_result
3.9.21mysqli_stmt: num_rows美元mysqli_stmt: num_rowsmysqli_stmt_num_rows
3.9.22mysqli_stmt: param_count美元mysqli_stmt_param_count
3.9.23mysqli_stmt:准备mysqli_stmt_prepare
3.9.24mysqli_stmt:重置mysqli_stmt_reset
3.9.25mysqli_stmt: result_metadatamysqli_stmt_result_metadata
3.9.26mysqli_stmt: send_long_datamysqli_stmt_send_long_data
3.9.27mysqli_stmt:: $ sqlstatemysqli_stmt_sqlstate
3.9.28mysqli_stmt: store_resultmysqli_stmt_store_result
3.10 mysqli_result类
3.10.1mysqli_result: current_field美元mysqli_field_tell
3.10.2mysqli_result: data_seekmysqli_data_seek
3.10.3mysqli_result: fetch_allmysqli_fetch_all
3.10.4mysqli_result:访问fetch_arraymysqli_fetch_array
3.10.5mysqli_result: fetch_assocmysqli_fetch_assoc
3.10.6mysqli_result: fetch_field_directmysqli_fetch_field_direct
3.10.7mysqli_result: fetch_fieldmysqli_fetch_field
3.10.8mysqli_result: fetch_fieldsmysqli_fetch_fields
3.10.9mysqli_result: fetch_objectmysqli_fetch_object
3.10.10mysqli_result: fetch_rowmysqli_fetch_row
3.10.11mysqli_result: field_count美元mysqli_num_fields
3.10.12mysqli_result: field_seekmysqli_field_seek
3.10.13mysqli_result:免费mysqli_result:关闭mysqli_result: free_resultmysqli_free_result
3.10.14mysqli_result:: $长度mysqli_fetch_lengths
3.10.15mysqli_result: num_rows美元mysqli_num_rows
3.11 mysqli_driver类
3.11.1mysqli_driver: embedded_server_endmysqli_embedded_server_end
3.11.2mysqli_driver: embedded_server_startmysqli_embedded_server_start
3.11.3mysqli_driver: report_mode美元mysqli_report
3.12 mysqli_warning类
3.12.1mysqli_warning:下一个
3.13 mysqli_sql_exception类
3.14别名和已弃用的Mysqli函数
3.14.1mysqli_connect
3.14.2mysqli: escape_stringmysqli_escape_string
3.14.3mysqli_execute
3.14.4mysqli_get_client_stats
3.14.5mysqli_get_links_stats
3.14.6mysqli_report
3.14.7mysqli: set_optmysqli_set_opt
3.15更新日志
4 MySQL函数(PDO_MYSQL)
4.1PDO_MYSQL DSN
5 Mysql_xdevapi
5.1安装/配置
5.1.1需求
5.1.2安装
5.1.3运行时配置
5.1.4从源代码编译
5.2预定义常量
5.3的例子
5.4 Mysql_xdevapi函数
5.4.1之前表达式
5.4.2getSession
5.5 BaseResult界面
5.5.1BaseResult: getWarnings
5.5.2BaseResult: getWarningsCount
5.6客户端类
5.6.1mysql_xdevapi \客户:关闭
5.6.2客户:__construct
5.6.3客户:getClient
5.7集合类
5.7.1收藏:添加
5.7.2收藏:addOrReplaceOne
5.7.3收藏:__construct
5.7.4收藏:数
5.7.5收藏::方法createIndex
5.7.6收藏:dropIndex
5.7.7收藏:existsInDatabase
5.7.8收藏:找到
5.7.9收藏:getName
5.7.10收藏:getOne
5.7.11收藏:getSchema
5.7.12收藏:getSession
5.7.13收藏:修改
5.7.14收藏:删除
5.7.15收藏:removeOne
5.7.16收藏:replaceOne
5.8 CollectionAdd类
5.8.1CollectionAdd: __construct
5.8.2CollectionAdd:执行
5.9 CollectionFind类
5.9.1CollectionFind:绑定
5.9.2CollectionFind: __construct
5.9.3CollectionFind:执行
5.9.4CollectionFind:字段
5.9.5CollectionFind: groupBy
5.9.6CollectionFind::
5.9.7CollectionFind:限制
5.9.8CollectionFind: lockExclusive
5.9.9CollectionFind: lockShared
5.9.10CollectionFind:抵消
5.9.11CollectionFind::
5.10 CollectionModify类
5.10.1CollectionModify: arrayAppend
5.10.2CollectionModify: arrayInsert
5.10.3CollectionModify:绑定
5.10.4CollectionModify: __construct
5.10.5CollectionModify:执行
5.10.6CollectionModify:限制
5.10.7CollectionModify:补丁
5.10.8CollectionModify:替换
5.10.9CollectionModify:集
5.10.10CollectionModify:跳过
5.10.11CollectionModify::
5.10.12CollectionModify:设置
5.11 CollectionRemove类
5.11.1CollectionRemove:绑定
5.11.2CollectionRemove: __construct
5.11.3CollectionRemove:执行
5.11.4CollectionRemove:限制
5.11.5CollectionRemove::
5.12 ColumnResult类
5.12.1ColumnResult: __construct
5.12.2ColumnResult: getCharacterSetName
5.12.3ColumnResult: getCollationName
5.12.4ColumnResult: getColumnLabel
5.12.5ColumnResult: getColumnName
5.12.6ColumnResult: getFractionalDigits
5.12.7ColumnResult: getLength
5.12.8ColumnResult: getSchemaName
5.12.9ColumnResult: getTableLabel
5.12.10ColumnResult: getTableName
5.12.11ColumnResult::方法
5.12.12ColumnResult: isNumberSigned
5.12.13ColumnResult: isPadded
5.13 CrudOperationBindable界面
5.13.1CrudOperationBindable:绑定
5.14 CrudOperationLimitable界面
5.14.1CrudOperationLimitable:限制
5.15 CrudOperationSkippable界面
5.15.1CrudOperationSkippable:跳过
5.16 CrudOperationSortable界面
5.16.1CrudOperationSortable::
5.17 DatabaseObject界面
5.17.1DatabaseObject: existsInDatabase
5.17.2DatabaseObject: getName
5.17.3DatabaseObject: getSession
5.18 DocResult类
5.18.1DocResult: __construct
5.18.2DocResult:: fetchAll
5.18.3DocResult: fetchOne
5.18.4DocResult: getWarnings
5.18.5DocResult: getWarningsCount
5.19异常类
5.20执行界面
5.20.1可执行:执行
5.21 ExecutionStatus类
5.21.1ExecutionStatus: __construct
5.22表达类
5.22.1表达式:__construct
5.23结果类
5.23.1结果::__construct
5.23.2结果::getAffectedItemsCount
5.23.3结果::getAutoIncrementValue
5.23.4结果::getGeneratedIds
5.23.5结果::getWarnings
5.23.6结果::getWarningsCount
5.24 RowResult类
5.24.1RowResult: __construct
5.24.2RowResult:: fetchAll
5.24.3RowResult: fetchOne
5.24.4RowResult: getColumnsCount
5.24.5RowResult: getcolumnname
5.24.6RowResult: getColumns
5.24.7RowResult: getWarnings
5.24.8RowResult: getWarningsCount
5.25模式类
5.25.1模式:__construct
5.25.2模式:createCollection
5.25.3模式:dropCollection
5.25.4模式:existsInDatabase
5.25.5模式:getCollection
5.25.6模式:getCollectionAsTable
5.25.7模式:getcollection
5.25.8模式:getName
5.25.9模式:getSession
5.25.10模式:可以获得的
5.25.11模式:可以获得的
5.26 SchemaObject界面
5.26.1SchemaObject: getSchema
5.27会议类
5.27.1会话:关闭
5.27.2会话:提交
5.27.3会话:__construct
5.27.4会话:createSchema
5.27.5会话:dropSchema
5.27.6会话:generateUUID
5.27.7会话:getDefaultSchema
5.27.8会话:getSchema
5.27.9会话:getSchemas
5.27.10会话:getServerVersion
5.27.11会话:listClients
5.27.12会话:quoteName
5.27.13会话:releaseSavepoint
5.27.14会话:回滚
5.27.15会话:rollbackTo
5.27.16会话:setSavepoint
5.27.17会话:sql
5.27.18会话:startTransaction
5.28 SqlStatement类
5.28.1SqlStatement:绑定
5.28.2SqlStatement: __construct
5.28.3SqlStatement:执行
5.28.4SqlStatement: getNextResult
5.28.5SqlStatement: getResult
5.28.6SqlStatement: hasMoreResults
5.29 SqlStatementResult类
5.29.1SqlStatementResult: __construct
5.29.2SqlStatementResult:: fetchAll
5.29.3SqlStatementResult: fetchOne
5.29.4SqlStatementResult: getAffectedItemsCount
5.29.5SqlStatementResult: getColumnsCount
5.29.6SqlStatementResult: getcolumnname
5.29.7SqlStatementResult: getColumns
5.29.8SqlStatementResult: getGeneratedIds
5.29.9SqlStatementResult: getLastInsertId
5.29.10SqlStatementResult: getWarnings
5.29.11SqlStatementResult: getWarningsCount
5.29.12SqlStatementResult: hasData
5.29.13SqlStatementResult: nextResult
5.30声明类
5.30.1声明::__construct
5.30.2声明::getNextResult
5.30.3声明::getResult
5.30.4声明::hasMoreResults
5.31表类
5.31.1表::__construct
5.31.2表::数
5.31.3表::删除
5.31.4表::existsInDatabase
5.31.5表::getName
5.31.6表::getSchema
5.31.7表::getSession
5.31.8表::插入
5.31.9表::isView
5.31.10表::选择
5.31.11表::更新
5.32 TableDelete类
5.32.1TableDelete:绑定
5.32.2TableDelete: __construct
5.32.3TableDelete:执行
5.32.4TableDelete:限制
5.32.5TableDelete: orderby
5.32.6TableDelete::
5.33 TableInsert类
5.33.1TableInsert: __construct
5.33.2TableInsert:执行
5.33.3TableInsert:值
5.34 TableSelect类
5.34.1TableSelect:绑定
5.34.2TableSelect: __construct
5.34.3TableSelect:执行
5.34.4TableSelect: groupBy
5.34.5TableSelect::
5.34.6TableSelect:限制
5.34.7TableSelect: lockExclusive
5.34.8TableSelect: lockShared
5.34.9TableSelect:抵消
5.34.10TableSelect: orderby
5.34.11TableSelect::
5.35 TableUpdate类
5.35.1TableUpdate:绑定
5.35.2TableUpdate: __construct
5.35.3TableUpdate:执行
5.35.4TableUpdate:限制
5.35.5TableUpdate: orderby
5.35.6TableUpdate:集
5.35.7TableUpdate::
5.36警告类
5.36.1警告::__construct
6 MySQL原始API
6.1安装/配置
但是需求
6.1.2安装
6.1.3运行时配置
6.1.4资源类型
6.2更新日志
6.3预定义常量
6.4的例子
6.4.1 MySQL扩展概述示例
6.5 MySQL函数
6.5.1mysql_affected_rows
6.5.2mysql_client_encoding
6.5.3mysql_close
6.5.4首先
6.5.5mysql_create_db
6.5.6mysql_data_seek
6.5.7mysql_db_name
6.5.8mysql_db_query
6.5.9mysql_drop_db
6.5.10mysql_errno
6.5.11mysql_error
6.5.12mysql_escape_string
6.5.13mysql_fetch_array
6.5.14作用是
6.5.15作用
6.5.16mysql_fetch_lengths
6.5.17mysql_fetch_object
6.5.18mysql_fetch_row
6.5.19作用
6.5.20作用是
6.5.21mysql_field_name
6.5.22mysql_field_seek
6.5.23mysql_field_table
6.5.24作用是
6.5.25:
6.5.26mysql_get_client_info
6.5.27mysql_get_host_info
6.5.28mysql_get_proto_info
6.5.29mysql_get_server_info
6.5.30mysql_info
6.5.31mysql_insert_id
6.5.32mysql_list_dbs
6.5.33mysql_list_fields
6.5.34mysql_list_processes
6.5.35mysql_list_tables
6.5.36mysql_num_fields
6.5.37mysql_num_rows
6.5.38永久链接
6.5.39mysql_ping
6.5.40mysql_query
6.5.41mysql_real_escape_string
6.5.42mysql_result
6.5.43mysql_select_db
6.5.44mysql_set_charset
6.5.45mysql_stat
6.5.46mysql_tablename
6.5.47mysql_thread_id
6.5.48mysql_unbuffered_query
7 MySQL本地驱动程序
7.1概述
7.2安装
7.3运行时配置
7.4不兼容
7.5持久连接
7.6统计
7.7笔记
7.8内存管理
7.9 MySQL本地驱动插件API
7.9.1 mysqlnd插件和MySQL Proxy的比较
7.9.2获取mysqlnd插件API
7.9.3 MySQL本地驱动插件架构
7.9.4 mysqlnd插件API
7.9.5开始构建mysqlnd插件
MySQL和PHP的常见问题