RE: [PHP-DB] # of Records in Table
| From: | Zach Curtis | Date: | Wed, 23 Jan 2002 21:52:12 +0000 |
| Subject: | RE: [PHP-DB] # of Records in Table | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-16127@lists.php.net to get a copy of this message | ||
The key field is the password field, which is also the field that I would
like to retrieve for that last record.
Zach
-----Original Message-----
From: DL Neil [mailto:PHPml@DandE.HomeChoice.co.uk]
Sent: Wednesday, January 23, 2002 2:08 PM
To: Zach Curtis
Cc: php-db@lists.php.net
Subject: Re: [PHP-DB] # of Records in Table
Zach,
How can this "last record" be identified? Is there a key field or something
similar?
Again: We might need to see the table definition to answer this.
Please advise,
=dn
----- Original Message -----
From: "Zach Curtis" <zach@populus.com>
To: "DL Neil" <PHPml@DandE.HomeChoice.co.uk>
Sent: 23 January 2002 20:49
Subject: RE: [PHP-DB] # of Records in Table
> The last record should be whatever the last record is in the table. For
> example, if there are 1000 records in the table which COUNT(*) will tell
me,
> how can I get the password for record 1000. The only thing I can do that
> would probably work is two query statements, one selecting COUNT(*) and
the
> other selecting "password". What I don't like about this method is that I
> would have to retrieve all of the passwords into an array, which I would
> assume would be slow on larger tables. Ideally, I thought their would be a
> way to do this operation in one select statement. Any thoughts?
>
>
> Zach
>
> -----Original Message-----
> From: DL Neil [mailto:PHPml@DandE.HomeChoice.co.uk]
> Sent: Wednesday, January 23, 2002 1:11 PM
> To: Zach Curtis; php-db@lists.php.net
> Subject: Re: [PHP-DB] # of Records in Table
>
>
> Zach,
>
> > What syntax can I use to determine how many records are in a MySQL table
> and
> > then retrieve the value of the field "password" for the last record? I
> tried
> > using some combinations of COUNT(*) and LIMIT with no success.
>
>
> SELECT COUNT(*) will answer the first part. What did you try that lacked
> success?
>
> How do you define "last record"? We might need to see the table definition
> to answer this.
>
> Regards,
> =dn
>
>
>
>
>