Welcome to WebmasterWorld Guest from 54.211.136.250

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Select From Database

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

5+ Year Member



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

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

WebmasterWorld Senior Member 10+ Year Member



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..!
12:17 pm on Sep 21, 2005 (gmt 0)

5+ Year Member



Thank You for your replay but there is now a one sql statement
12:27 pm on Sep 21, 2005 (gmt 0)

10+ Year Member



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.

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

5+ Year Member



Thank You

It works correctly

I hope i will help you