深圳全飞鸿

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 648|回复: 0
打印 上一主题 下一主题

adodb函数:GetAll

[复制链接]

800

主题

1379

帖子

7706

积分

版主

Rank: 7Rank: 7Rank: 7

积分
7706
跳转到指定楼层
楼主
发表于 2019-9-5 22:28:57 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
adodb函数:GetAll

我们可以使用GetAll方法代替Execute()方法,该方法返回的结果为一个二维关联数据,这样可以使用foreach或for循环语句处理,非常方便。
另外,GetAll取得的数组与Smarty模板的foreach配合得非常好。

官方说明:

GetAll完全等于GetArray
  1. The function executes a statement and returns a the entire recordset in an array or false if the statement execution fails. If no records match the provided SQL statement, an empty array is returned.

  2. The presentation of the returned data can be modified by the variables $ADODB_FETCH_MODE and $ADODB_ASSOC_CASE and the function setFetchMode().
复制代码

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|nagomes  

GMT+8, 2025-5-5 06:35 , Processed in 0.025524 second(s), 21 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表