[ciapug] Adodb: RecordCount()
Chris Hettinger
ciapug@cialug.org
Fri, 24 Oct 2003 09:35:33 -0500
Thanks will try it that way. I did consider using "SELECT count()..." =
But I still need to the results set and am trying to limit the numbers =
of DB hits... so if I can count it without another db query that would =
be best.
Thanks Laith.
-----Original Message-----
From: Lathrop Preston [mailto:laith@prestonfam.org]
Sent: Friday, October 24, 2003 9:30 AM
To: ciapug@cialug.org
Subject: Re: [ciapug] Adodb: RecordCount()
This is ugly but it should work in most db
"SELECT *, count(*) as foo_cn FROM states";
As far as RecordCount goes... it is a function for the record set Not=20
the connection...
use
$count =3D $results->RecordCount();
Laith
Chris Hettinger wrote:
> I am having a small issue with the Adodb (version 4.01) function =
RecordCount().
> Here is the documentation on this function: =
http://phplens.com/lens/adodb/docs-adodb.htm#recordcount
>=20
> Example:
> $sql =3D "SELECT * FROM states";
> $results =3D $db->Execute($sql);
>=20
> // result set should then list 50 records
>=20
> I am having an issue with the syntax to use this function.... I would =
assume I would need pass it my result set or the query??? I have tried =
several different ways...
>=20
> $count =3D RecordCount($sql);
>=20
> or
>=20
> $count =3D $db->RecordCount($sql);
>=20
> ... No matter what I try I receive the error: Fatal error: Call to =
undefined function: recordcount()...
>=20
> I want to know the number of records returned in my result set. I =
don't want to use a counter and while loop to do this.
>=20
> -Chris Hettinger, Web Specialist
> -IFMC/ENCOMPASS
> -www.encompas.com
> -(515) 279-8730
>=20
>=20
>=20
> CONFIDENTIALITY NOTICE: This communication, including any attachment, =
may contain confidential information and is intended only for the =
individual or entity to whom it is addressed. Any review, =
dissemination, or copying of this communication by anyone other than the =
intended recipient is strictly prohibited. If you are not the intended =
recipient, please contact the sender by reply email, delete and destroy =
all copies of the original message.'
>=20
> _______________________________________________
> ciapug mailing list
> ciapug@cialug.org
> http://cialug.org/mailman/listinfo/ciapug
_______________________________________________
ciapug mailing list
ciapug@cialug.org
http://cialug.org/mailman/listinfo/ciapug
CONFIDENTIALITY NOTICE: This communication, including any attachment, =
may contain confidential information and is intended only for the =
individual or entity to whom it is addressed. Any review, =
dissemination, or copying of this communication by anyone other than the =
intended recipient is strictly prohibited. If you are not the intended =
recipient, please contact the sender by reply email, delete and destroy =
all copies of the original message.'