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

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

WBOY
WBOYOriginal
2016-06-13 13:09:35767browse

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


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

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