homepage Welcome to WebmasterWorld Guest from 54.197.171.109
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Select From Database
kees mekhalel




msg:1314101
 11:56 am on Sep 21, 2005 (gmt 0)

I want and SQL Select Command That

select row where it have the maximam ID

like

select Max(ID) From Table

It will retrieve the maximum ID

but i want to retrieve the whole row

 

omoutop




msg:1314102
 12:04 pm on Sep 21, 2005 (gmt 0)

hi!
if u need the whole row then u need another query below to select * from Table where ID = '$ID' (which is the one u have just retrieved in the previous query)....u run the query and fetch all remaining data....hope the best..!

kees mekhalel




msg:1314103
 12:17 pm on Sep 21, 2005 (gmt 0)

Thank You for your replay but there is now a one sql statement

jpjones




msg:1314104
 12:27 pm on Sep 21, 2005 (gmt 0)

Try

SELECT * FROM Table ORDER BY ID DESC LIMIT 1

This has the effect of returning the full contents of 1 row, with the highest (Max) ID.

kees mekhalel




msg:1314105
 12:33 pm on Sep 21, 2005 (gmt 0)

Thank You

It works correctly

I hope i will help you

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved