Home > Backend Development > PHP Tutorial > 请教怎么将mysql_fetch_object得到的对象塞到数组里面

请教怎么将mysql_fetch_object得到的对象塞到数组里面

WBOY
Release: 2016-06-13 10:22:52
Original
819 people have browsed it

请问如何将mysql_fetch_object得到的对象塞到数组里面?

$jvp_list = array ();
while($rs= mysql_fetch_object($result)){
$jvp_list[] = $rs;
}

这样好象不行噢,请帮忙。


------解决方案--------------------
你的jvp_list也没声明为global啊?
------解决方案--------------------

探讨

引用:

把 $jvp_list 改为 $this->jvp_list


谢谢,非常好,不过为什么一定要加上this?
c++那样在类成员函数里面访问数据成员可加可不加的。

------解决方案--------------------
探讨
谢谢,非常好,不过为什么一定要加上this?
c++那样在类成员函数里面访问数据成员可加可不加的。
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