Posted by Kimmo Laine on 12/19/05 21:28
<briansmccabe@gmail.com> kirjoitti
viestissδ:1135016969.513258.276220@g44g2000cwa.googlegroups.com...
> Does anyone have a good approach to displaying in PHP a simple COUNT
> query that is performed on a table in a MySQL db?
>
$result = mysql_query('SELECT COUNT(*) AS foo FROM table') or
die(mysql_error());
$bar = mysql_fetch_array($result);
echo $bar['foo'];
--
SETI @ Home - Donate your cpu's idle time to science.
Further reading at <http://setiweb.ssl.berkeley.edu/>
Kimmo Laine <antaatulla.sikanautaa@gmail.com.NOSPAM.invalid>
Navigation:
[Reply to this message]
|