Jump to content

[SOLVED] mysql: select largest number


sandrob57

Recommended Posts

My current query:

 

$result = dbquery("SELECT user_id FROM fusion_ip WHERE user_id='".$userdata['user_id']."'");

 

I want the query to select the row with the highest number (or, in this case, datestamp).

 

So if this were the database

 

___ip_id____ ___user_id___ ____ip____ ____date____

1

1

7.777.77.7123413243

2

1

5.555.55.5343434343

3

1

7.777.77.7543245234

 

The query would select row 3 because the date is the most recent

 

 

Link to comment
https://forums.phpfreaks.com/topic/58171-solved-mysql-select-largest-number/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.