make profile pages show posts in right order
This commit is contained in:
@@ -106,7 +106,7 @@ std::optional<Post> Database::getPost(uint64_t id) {
|
|||||||
|
|
||||||
std::vector<Post> Database::getUserPosts(uint64_t userId) {
|
std::vector<Post> Database::getUserPosts(uint64_t userId) {
|
||||||
std::stringstream sql;
|
std::stringstream sql;
|
||||||
sql << "SELECT * FROM posts WHERE userid = " << userId << ";";
|
sql << "SELECT * FROM posts WHERE userid = " << userId << " ORDER BY timestamp DESC LIMIT 100;";
|
||||||
std::string sqlstr = sql.str();
|
std::string sqlstr = sql.str();
|
||||||
|
|
||||||
sqlite3_stmt* stmt;
|
sqlite3_stmt* stmt;
|
||||||
|
|||||||
Reference in New Issue
Block a user