Jump to content

find out how many in a table


shirvo

Recommended Posts

Don't rely on an auto-incrementing primary key to determine the latest records (that is not there intended purpose, and it will prove unreliable), put a timestamp in your table then order by that with a limit of 4. eg;

 

SELECT username FROM users ORDER BY tstamp DESC LIMIT 4;

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.