I just wanna show last 10 or 30 depends on list if there is big data, searched over the net but all by correcting I can see only the 1st data not newest one.
$sql = "SELECT id, tag, count FROM url ORDER BY id, tag, count ASC LIMIT 1";
I am testing with two datat on database and want to display last one but all the time it shows the oldest one (first data), I changed ASC and DESC also, both time result is same.
Use this one:
$Query = "SELECT id, tag, count FROM url ORDER BY id DESC LIMIT 10"
Try this..
Order by id using "DESC" it get last to first and limit 0,10 means it display last 10 record
$sql = "SELECT id, tag, count FROM url ORDER BY id DESC LIMIT 0 10"
Change your query & try this:
$Query = "SELECT id, tag, count FROM url ORDER BY id DESC LIMIT 10";