My website (thanks to help from many of you here on SO) is set up to display a fixed number of updates (52) where each Friday, one rotates out, and a new one rotates in. The 52 updates are displayed 4 per page across 13 pages. It works perfectly.
However, the new update appears at the END of the displayed updates. I would like the new update to be the first one people will see.
Here is my query:
$conn = dbConnect('query');
$updates = "SELECT update_id, update_title, update_desc, path
FROM updates
WHERE flag_live = ?
ORDER BY update_id DESC
LIMIT ?, ?";
$stmt = $conn->prepare($updates);
$stmt->bind_param('sii', $uLive, $offset, $limit);
$stmt->bind_result($uId, $uTitle, $uDesc, $uPath);
$stmt->execute();
$stmt->store_result();
$stmt->fetch();
I want the items to display in reverse order as they currently do. If I change the ORDER BY
from DESC
to ASC
it picks a different set of data which I do not want. Thus, from my research I have seen that either array_reverse()
or rsort
would do the trick. I need to know what syntax is correct to use array_reverse()
properly here.