NYCPHP Meetup

NYPHP.org

[nycphp-talk] MySQL count( * ) syntax question

Daniel Convissor danielc at analysisandsolutions.com
Mon Feb 9 20:17:08 EST 2004


On Mon, Feb 09, 2004 at 05:08:47PM -0800, Hans Zaunere wrote:

> I think there are two issues here.  For one, using COUNT() will return a
> row, containing a count of zero.

But, if my memory serves me correclty, in PHP, that "row" doesn't show up 
if the count is 0.

--Dan

-- 
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
            data intensive web and database programming
                http://www.AnalysisAndSolutions.com/
 4015 7th Ave #4, Brooklyn NY 11232  v: 718-854-0335 f: 718-854-0409

>From hans not junk at nyphp.com  Mon Feb  9 20:22:54 2004
Return-Path: <hans not junk at nyphp.com>
Received: from ehost011-1.exch011.intermedia.net (unknown [64.78.21.3])
	by virtu.nyphp.org (Postfix) with ESMTP id 231BCA8602
	for <talk at lists.nyphp.org>; Mon,  9 Feb 2004 20:22:54 -0500 (EST)
X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Subject: RE: [nycphp-talk] MySQL count( * ) syntax question
Date: Mon, 9 Feb 2004 17:22:54 -0800
Message-ID: <41EE526EC2D3C74286415780D3BA9F87772522 at ehost011-1.exch011.intermedia.net>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: [nycphp-talk] MySQL count( * ) syntax question
Thread-Index: AcPvc6BIFiLBcbBlSd6C9RFnbXxuoAAAH1Tg
From: "Hans Zaunere" <hans not junk at nyphp.com>
To: "NYPHP Talk" <talk at lists.nyphp.org>
X-BeenThere: talk at lists.nyphp.org
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: NYPHP Talk <talk at lists.nyphp.org>
List-Id: NYPHP Talk  <talk.lists.nyphp.org>
List-Unsubscribe: <http://lists.nyphp.org/mailman/listinfo/talk>,
	<mailto:talk-request at lists.nyphp.org?subject=unsubscribe>
List-Archive: <http://lists.nyphp.org/pipermail/talk>
List-Post: <mailto:talk at lists.nyphp.org>
List-Help: <mailto:talk-request at lists.nyphp.org?subject=help>
List-Subscribe: <http://lists.nyphp.org/mailman/listinfo/talk>,
	<mailto:talk-request at lists.nyphp.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Feb 2004 01:22:54 -0000


> > I think there are two issues here.  For one, using COUNT() will =
return a
> > row, containing a count of zero.
>=20
> But, if my memory serves me correclty, in PHP, that "row"=20
> doesn't show up if the count is 0.

Hmm...

<?php
$mydb =3D mysql_connect('localhost','blah','blahblah');

$result =3D mysql_query("SELECT COUNT(user) FROM mysql.user WHERE =
user=3D'blahblahblah'");

var_dump(mysql_fetch_row($result));
?>

array(1) {
  [0]=3D>
  string(1) "0"
}


H



More information about the talk mailing list