Home  >  Article  >  Backend Development  >  Smarty的一个有关问题

Smarty的一个有关问题

WBOY
WBOYOriginal
2016-06-13 11:59:37986browse

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


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

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

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

Statement:
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