Re: Retrieving result of COUNT(*) with PHP

From: Alan Hodgson <ahodgson(at)simkin(dot)ca>
To: pgsql-php(at)postgresql(dot)org
Subject: Re: Retrieving result of COUNT(*) with PHP
Date: 2007-03-28 21:43:05
Message-ID: 200703281443.05137@hal.medialogik.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

On Wednesday 28 March 2007 14:31, "Valentín Orfila"
<valentinorfila(at)gmail(dot)com> 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

In response to

Browse pgsql-php by date

  From Date Subject
Next Message Lynna Landstreet 2007-03-29 00:13:01 Re: Retrieving result of COUNT(*) with PHP
Previous Message Gavin M. Roy 2007-03-28 21:38:46 Re: Retrieving result of COUNT(*) with PHP