第七节:PHP与MYSQL
常见函数
PHP5-MYSQL
函数 | 描述 |
---|---|
https://www.runoob.com/php/func-mysqli-affected-rows.html | 返回前一次 MySQL 操作所影响的记录行数。 |
https://www.runoob.com/php/func-mysqli-autocommit.html | 打开或关闭自动提交数据库修改。 |
https://www.runoob.com/php/func-mysqli-change-user.html | 更改指定数据库连接的用户。 |
https://www.runoob.com/php/func-mysqli-character-set-name.html | 返回数据库连接的默认字符集。 |
https://www.runoob.com/php/func-mysqli-close.html | 关闭先前打开的数据库连接。 |
https://www.runoob.com/php/func-mysqli-commit.html | 提交当前事务。 |
https://www.runoob.com/php/func-mysqli-connect-errno.html | 返回上一次连接错误的错误代码。 |
https://www.runoob.com/php/func-mysqli-connect-error.html | 返回上一次连接错误的错误描述。 |
https://www.runoob.com/php/func-mysqli-connect.html | 打开一个到 MySQL 服务器的新的连接。 |
https://www.runoob.com/php/func-mysqli-data-seek.html | 调整结果指针到结果集中的一个任意行。 |
https://www.runoob.com/php/func-mysqli-debug.html | 执行调试操作。 |
https://www.runoob.com/php/func-mysqli-dump-debug-info.html | 转储调试信息到日志中。 |
https://www.runoob.com/php/func-mysqli-errno.html | 返回最近调用函数的最后一个错误代码。 |
https://www.runoob.com/php/func-mysqli-error-list.html | 返回最近调用函数的错误列表。 |
https://www.runoob.com/php/func-mysqli-error.html | 返回最近调用函数的最后一个错误描述。 |
https://www.runoob.com/php/func-mysqli-fetch-all.html | 从结果集中取得所有行作为关联数组,或数字数组,或二者兼有。 |
https://www.runoob.com/php/func-mysqli-fetch-array.html | 从结果集中取得一行作为关联数组,或数字数组,或二者兼有。 |
https://www.runoob.com/php/func-mysqli-fetch-assoc.html | 从结果集中取得一行作为关联数组。 |
https://www.runoob.com/php/func-mysqli-fetch-field-direct.html | 从结果集中取得某个单一字段的 meta-data,并作为对象返回。 |
https://www.runoob.com/php/func-mysqli-fetch-field.html | 从结果集中取得下一字段,并作为对象返回。 |
https://www.runoob.com/php/func-mysqli-fetch-fields.html | 返回结果中代表字段的对象的数组。 |
https://www.runoob.com/php/func-mysqli-fetch-lengths.html | 返回结果集中当前行的每个列的长度。 |
https://www.runoob.com/php/func-mysqli-fetch-object.html | 从结果集中取得当前行,并作为对象返回。 |
https://www.runoob.com/php/func-mysqli-fetch-row.html | 从结果集中取得一行,并作为枚举数组返回。 |
https://www.runoob.com/php/func-mysqli-field-count.html | 返回最近查询的列数。 |
https://www.runoob.com/php/func-mysqli-field-seek.html | 把结果集中的指针设置为指定字段的偏移量。 |
https://www.runoob.com/php/func-mysqli-field-tell.html | 返回结果集中的指针的位置。 |
https://www.runoob.com/php/func-mysqli-free-result.html | 释放结果内存。 |
https://www.runoob.com/php/func-mysqli-get-charset.html | 返回字符集对象。 |
https://www.runoob.com/php/func-mysqli-get-client-info.html | 返回 MySQL 客户端库版本。 |
https://www.runoob.com/php/func-mysqli-get-client-stats.html | 返回有关客户端每个进程的统计。 |
https://www.runoob.com/php/func-mysqli-get-client-version.html | 将 MySQL 客户端库版本作为整数返回。 |
https://www.runoob.com/php/func-mysqli-get-connection-stats.html | 返回有关客户端连接的统计。 |
https://www.runoob.com/php/func-mysqli-get-host-info.html | 返回 MySQL 服务器主机名和连接类型。 |
https://www.runoob.com/php/func-mysqli-get-proto-info.html | 返回 MySQL 协议版本。 |
https://www.runoob.com/php/func-mysqli-get-server-info.html | 返回 MySQL 服务器版本。 |
https://www.runoob.com/php/func-mysqli-get-server-version.html | 将 MySQL 服务器版本作为整数返回。 |
https://www.runoob.com/php/func-mysqli-info.html | 返回有关最近执行查询的信息。 |
https://www.runoob.com/php/func-mysqli-init.html | 初始化 MySQLi 并返回 mysqli_real_connect() 使用的资源。 |
https://www.runoob.com/php/func-mysqli-insert-id.html | 返回最后一个查询中自动生成的 ID。 |
https://www.runoob.com/php/func-mysqli-kill.html | 请求服务器杀死一个 MySQL 线程。 |
https://www.runoob.com/php/func-mysqli-more-results.html | 检查一个多查询是否有更多的结果。 |
https://www.runoob.com/php/func-mysqli-multi-query.html | 执行一个或多个针对数据库的查询。 |
https://www.runoob.com/php/func-mysqli-next-result.html | 为 mysqli_multi_query() 准备下一个结果集。 |
https://www.runoob.com/php/func-mysqli-num-fields.html | 返回结果集中字段的数量。 |
https://www.runoob.com/php/func-mysqli-num-rows.html | 返回结果集中行的数量。 |
https://www.runoob.com/php/func-mysqli-options.html | 设置额外的连接选项,用于影响连接行为。 |
https://www.runoob.com/php/func-mysqli-ping.html | 进行一个服务器连接,如果连接已断开则尝试重新连接。 |
mysqli_prepare() | 准备执行一个 SQL 语句。 |
https://www.runoob.com/php/func-mysqli-query.html | 执行某个针对数据库的查询。 |
https://www.runoob.com/php/func-mysqli-real-connect.html | 打开一个到 MySQL 服务器的新的链接。 |
https://www.runoob.com/php/func-mysqli-real-escape-string.html | 转义在 SQL 语句中使用的字符串中的特殊字符。 |
mysqli_real_query() | 执行 SQL 查询 |
mysqli_reap_async_query() | 返回异步查询的结果。 |
https://www.runoob.com/php/func-mysqli-refresh.html | 刷新表或缓存,或者重置复制服务器信息。 |
https://www.runoob.com/php/func-mysqli-rollback.html | 回滚数据库中的当前事务。 |
https://www.runoob.com/php/func-mysqli-select-db.html | 更改连接的默认数据库。 |
https://www.runoob.com/php/func-mysqli-set-charset.html | 设置默认客户端字符集。 |
mysqli_set_local_infile_default() | 撤销用于 load local infile 命令的用户自定义句柄。 |
mysqli_set_local_infile_handler() | 设置用于 LOAD DATA LOCAL INFILE 命令的回滚函数。 |
https://www.runoob.com/php/func-mysqli-sqlstate.html | 返回最后一个 MySQL 操作的 SQLSTATE 错误代码。 |
https://www.runoob.com/php/func-mysqli-ssl-set.html | 用于创建 SSL 安全连接。 |
https://www.runoob.com/php/func-mysqli-stat.html | 返回当前系统状态。 |
https://www.runoob.com/php/func-mysqli-stmt-init.html | 初始化声明并返回 mysqli_stmt_prepare() 使用的对象。 |
mysqli_store_result() | 返回的当前的结果集。 |
https://www.runoob.com/php/func-mysqli-thread-id.html | 返回当前连接的线程 ID。 |
https://www.runoob.com/php/func-mysqli-thread-safe.html | 返回是否将客户端库编译成 thread-safe。 |
mysqli_use_result() | 从上次使用 mysqli_real_query() 执行的查询中初始化结果集的检索。 |
mysqli_warning_count() | 返回连接中的最后一个查询的警告数量。 |
MVC框架
概念
MVC是一种架构设计模式,按照这种方式设计的应用叫做MVC应用。它将应用程序拆分成三个核心部分:Model(模型)、View(视图)和Controller(控制器)。MVC应用会通过中介者来协调这三个部分的工作,并在它们之间传递信息。