Get only last value of a dynamic array

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

Not sure how you are creating your DB, can't be bothered figuring out all your code, but if it is generated from the DB, you can use a query.

Code: Select all

SELECT * FROM your_table ORDER BY id DESC LIMIT 1
You need to have an incremental id field though for this to work

Mark
User avatar
Canadian Pickle
Forum Newbie
Posts: 12
Joined: Wed Jun 23, 2004 11:12 am
Location: It a Canadian Fridge

Post by Canadian Pickle »

Thanks patrikG

I will look into doing that.

Beck100, I am afraid that will not work as pointed out by patrikG.

Thanks anyways!

:?
Post Reply