Re: Retrieving result of COUNT(*) with PHP

Alan Hodgson <[email protected]>
Newsgroups gmane.comp.db.postgresql.php
Organization Simkin Network Consulting
Message-ID <[email protected]>
On Wednesday 28 March 2007 14:31, "Valentín Orfila" 
<[email protected]> wrote:
> Where people this the way I do, count (*) could be slower
>
> <?
> $sql = "select * from TableName";
> $count = pg_query($sql);
> $count = pg_num_rows($count);
> ?>
> <td ><?=$count?></td>
>
> I thing that's enough :)

Apparently you have no tables with any real amount of data in them.

-- 
"It is a besetting vice of democracies to substitute public opinion for
law." - James Fenimore Cooper 


---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.