How to sort results from a custom database table

Don’t you mean this query:

"SELECT post_id FROM like WHERE user_id = %d ORDER BY id DESC"

where we assume that the id column is unique and increase with each like.

Leave a Comment