Home > Backend Development > PHP Tutorial > Smarty的一个问题

Smarty的一个问题

WBOY
Release: 2016-06-23 13:55:25
Original
916 people have browsed it

写了一个简单的db类,里面有两个方法,分别返回查询数组


问题是在index里面,实例化db类,调用这两个方法,分别打印出来,但是只能显示一个方法的结果,
要么是分别实例化两次db类,用不同的对象分别访问这两个方法,才能把结果集都打印出来,求解释啊


回复讨论(解决方案)

结果集已经读到尾部了,再读当然就读不到
你需要先回绕到头再读

select 和 field 方法的开头都需要有 mysql_data_seek($this->re, 0);

把你的Db类全贴出来 ~~

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template