i have an sql table below that i'm trying to select the most current entry based on the number in the timestamp field. can someone post code on how to do that? i need it for displaying the "currently logged in users" and the most current file they've viewed. the number in the timestamp field is generated using the time() function:
timestamp ip2 file2 username2
1074289944 x.x.x.x http://url.php admin
1074289960 x.x.x.x http://url.php admin
1074289935 x.x.x.x http://url.php admin
thank you!
select closest to most current time
Moderator: General Moderators
right
i understand that but i'm not just selecting MAX(timestamp)..i need to select everything in two tables including the MAX(timestamp) from the 2nd table.McGruff wrote:The most current is the highest value so:
"SELECT MAX(timestamp) as timestamp FROM table"