Any one know how I can write a php statement to call the last 4 entires from tbl_accounts by userID?
You need to do two things here.
First, order the results in descending order, so that the latest entry is first in the list. For this, you can use "ORDER BY userID DESC".
Then, you need to grab only the first four entries (the latest four additions). For this, use "LIMIT 4".
Altogether, it should look like this...
$query = "SELECT * FROM tbl_accounts ORDER BY userID DESC LIMIT 4";
Walkere
Junior Poster in Training
57 posts since Jan 2008
Reputation Points: 29
Solved Threads: 5