RE: [PHP] Getting the last record in a mysql table FINALLY!!

2002-01-18 Thread Chris Schneck
his should print out whatever the primary key # of the last insert query performed. This help at all? >From: Niklas Lampén <[EMAIL PROTECTED]> >Reply-To: <[EMAIL PROTECTED]> >To: "Php-General" <[EMAIL PROTECTED]> >Subject: RE: [PHP] Getting the last record

RE: [PHP] Getting the last record in a mysql table FINALLY!!

2002-01-17 Thread Niklas Lampén
Well, ofcourse you have to have the table + field names right. ;) Niklas -Original Message- From: hugh danaher [mailto:[EMAIL PROTECTED]] Sent: 18. tammikuuta 2002 9:38 To: [EMAIL PROTECTED] Cc: Php-General Subject: Re: [PHP] Getting the last record in a mysql table FINALLY

Re: [PHP] Getting the last record in a mysql table FINALLY!!

2002-01-17 Thread hugh danaher
TED]> To: Php-General <[EMAIL PROTECTED]> Sent: Thursday, January 17, 2002 10:29 PM Subject: RE: [PHP] Getting the last record in a mysql table > If you have ID that is a incrementing number, you could just query like > this: > 'SELECT ID FROM MY_TABLE ORDER BY ID DESC, LIMI

Re: [PHP] Getting the last record in a mysql table

2002-01-17 Thread Alex Chau
you have just one result, the last (biggest) ID number. > > >Niklas > > >-Original Message- >From: hugh danaher [mailto:[EMAIL PROTECTED]] >Sent: 18. tammikuuta 2002 7:37 >To: Php-General >Subject: [PHP] Getting the last record in a mysql table > > &g

RE: [PHP] Getting the last record in a mysql table

2002-01-17 Thread Niklas Lampén
You're welcome. Heh, why to make too hard. :) Niklas -Original Message- From: hugh danaher [mailto:[EMAIL PROTECTED]] Sent: 18. tammikuuta 2002 8:40 To: [EMAIL PROTECTED] Subject: Re: [PHP] Getting the last record in a mysql table Niklas, Now that sounds like a solution! T

RE: [PHP] Getting the last record in a mysql table

2002-01-17 Thread Niklas Lampén
Sent: 18. tammikuuta 2002 7:37 To: Php-General Subject: [PHP] Getting the last record in a mysql table Help! I thought this would be easy but it ain't. What I want is the id number of the last record in a table. I've tried a number of variations to the following but am getting no wher

Re: [PHP] Getting the last record in a mysql table

2002-01-17 Thread hugh danaher
D]> To: 'hugh danaher' <[EMAIL PROTECTED]>; Php-General <[EMAIL PROTECTED]> Sent: Thursday, January 17, 2002 9:40 PM Subject: RE: [PHP] Getting the last record in a mysql table > > I thought this would be easy but it ain't. What I want is > > the

RE: [PHP] Getting the last record in a mysql table

2002-01-17 Thread Jason Murray
> I thought this would be easy but it ain't. What I want is > the id number of the last record in a table. If you use mysql_num_rows() and decrement it by one, you'll have the ID of the row you can use with mysql_result. Jason -- PHP General Mailing List (http://www.php.net/) To unsubscrib

[PHP] Getting the last record in a mysql table

2002-01-17 Thread hugh danaher
Help! I thought this would be easy but it ain't. What I want is the id number of the last record in a table. I've tried a number of variations to the following but am getting no where! Any help will be greatly appreciated. Hugh $results=mysql_query(" SELECT last_insert_id() FROM MY_TABLE ")