RE: [PHP] PHP + MySQL - Load last inserts
| From: | abdulazeez alugo | Date: | Mon, 30 Mar 2009 15:31:30 +0000 |
| Subject: | RE: [PHP] PHP + MySQL - Load last inserts | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-290834@lists.php.net to get a copy of this message | ||
> Date: Mon, 30 Mar 2009 14:55:08 +0200
> From: s.muszytowski@googlemail.com
> To: php@addmissions.nl
> CC: php-general@lists.php.net
> Subject: Re: [PHP] PHP + MySQL - Load last inserts
>
> Thijs Lensselink schrieb:
> > Sebastian Muszytowski wrote:
> >
> >> Hello :)
> >>
> >> I have some troubles with php and mysql. I have a normal MySQL Query
> >> and this returns X > 3 rows.
> >> Now i want to get the last 3 inserted values. For Example i've inserted
> >>
> >> A, B, C, D, E
> >>
> >> I want to get the last inserted values, e.g. E D C (in reversed order)
> >>
> >> So how to do this? I already searched the web and the whole php.net site
> >> but i don't see any workaround.
> >>
> >> Thanks in advance
> >>
> >> Sebastian
> >>
> >>
> >>
> > It's not really a PHP question. But here goes :
> >
> > SELECT column FROM
table ORDER BY column DESC LIMIT 3
> >
> Oh okay thank you very much :)
>
> I thought I must do this with php and some sort of mysql_fetch_asssoc or
> something like this
>
Hey Dude,
I'm sure you don't wanna complicate issues for yourself. You've been given two
correct ways to go about it. I think you should try those.
Ciao.
_________________________________________________________________
Drag n’ drop—Get easy photo sharing with Windows Live™ Photos.
http://www.microsoft.com/windows/windowslive/products/photos.aspx