Re: Retrieve The Last Record in a Table
| From: | Jason Davidson | Date: | Tue, 27 Jul 2004 15:17:19 +0000 |
| Subject: | Re: Retrieve The Last Record in a Table | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-191975@lists.php.net to get a copy of this message | ||
You could LIMIT 2, using the order on a column, the first record would
be last, the second would be second last. Kinda dirty way to do it,
however, off hand, cant think of an alternative, ill post it if i do
think of one though.
Jason
On Tue, 27 Jul 2004 09:59:21 +0100, Harlequin
<michael.mason@arraspeople.co.uk> wrote:
> Thanks for that Jason
>
> Any suggestions on how I would retrieve the next to last entry...? The last
> time prior to this session that the user logged in...?
>
> --
> -----------------------------
> Michael Mason
> Arras People
> www.arraspeople.co.uk
> -----------------------------
> "Jason Davidson" <jason.davidson@gmail.com> wrote in message
> news:6c925ae2040726112334d593c0@mail.gmail.com...
>
>
> > as mentioned already, use a column in the table to order the query and
> > then use LIMIT to only to return one record. Best columns to use would
> > be an auto_increment or a datetime field type.
> >
> > Jason
> >
> > On Mon, 26 Jul 2004 18:27:25 +0100, Harlequin
> > <michael.mason@arraspeople.co.uk> wrote:
> > >
> > >
> > > I would like to retrieve the last entry in a login table and present
> that to
> > > a user so they can verify the date we have when they last logged in.
> > >
> > > Is this possible...?
> > >
> > > --
> > > -----------------------------
> > > Michael Mason
> > > Arras People
> > > www.arraspeople.co.uk
> > > -----------------------------
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>