So, what I’m trying to do is pretty much the same as what this website does each posting is given an id, and the posting with the highest id is displayed first, then the posting with the second highest is displayed second, etc, etc…
Is it something like;
<a href="posting.php?id=<?php echo max(*something goes here*) ?>
Any help appriciated
This is probably something that you should be doing in your SQL when you are fetching the data from the database. You can do it quite easily using an
order bystatement in your query like this:In this way, you are already pulling the data out of the database without having to do any ordering or structuring in your PHP code – the database will be more efficient than PHP for this.