如何遍历mysql结果集 [英] How to loop through a mysql result set
本文介绍了如何遍历mysql结果集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
循环访问 mysql 结果集有哪些不同的方法?我是 PHP 和 MySQL 的新手,所以我正在寻找简单的循环方法以及有关所提供代码如何工作的解释.
What are some different ways to loop through a mysql result set? I'm new to PHP and MySQL so I'm looking for simple ways to loop through and an explanation as to how the provided code works.
推荐答案
这是一个完整的例子:
http://php.net/manual/en/mysqli-result.fetch-array.php
- 连接
- 选择数据库
- 进行查询
- 循环结果并获取数组以获取行
这篇关于如何遍历mysql结果集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文