请问如何用PHP查询mysql返回的值

WBOY
Release: 2016-06-23 14:01:34
Original
1159 people have browsed it

比如我是查询的多少条 select count(*) from csdn;

在mysql里面是直接返回的多少条,比如是2039条。

那在PHP里面我怎么样把这个结果显示到页面来

我用mysql_fetch_row 返回来的是一个数组,应该用哪个函数来实现呢。


回复讨论(解决方案)

$rs = mysql_query('select count(*) from csdn');$row = mysql_fetch_row($rs);echo $row[0];
Copy after login
Copy after login

$rs = mysql_query('select count(*) from csdn');$row = mysql_fetch_row($rs);echo $row[0];
Copy after login
Copy after login


谢谢徐哥,明白了,mysql_fetch_row就是返回的是一个数组,然后取下标为0的值即可.

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