深圳全飞鸿

标题: adodb函数:GetAll [打印本页]

作者: zhgc    时间: 2019-9-5 22:28
标题: adodb函数:GetAll
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().
复制代码






欢迎光临 深圳全飞鸿 (http://www.nagomes.com/disc/) Powered by Discuz! X3.2