Home > Backend Development > PHP Tutorial > 初学者问个有关问题,如何读取sql返回结果中的数据

初学者问个有关问题,如何读取sql返回结果中的数据

WBOY
Release: 2016-06-13 10:52:05
Original
907 people have browsed it

菜鸟问个问题,怎么读取sql返回结果中的数据?
stdClass Object ( [count(*)] => 4 ) 
我用sql查询一个记录的数量,现在要读取4这个数值,要怎么写?谢谢!


------解决方案--------------------

PHP code
foreach( $arr as $v){    echo $v;}//或者直接echo $arr[0];<div class="clear">
                 
              
              
        
            </div>
Copy after login
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