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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.