about summary refs log tree commit diff stats
path: root/database.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'database.cpp')
-rw-r--r--database.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/database.cpp b/database.cpp index f8b5016..2885d1f 100644 --- a/database.cpp +++ b/database.cpp
@@ -44,7 +44,7 @@ database::~database()
44 44
45achievement database::getRandomAchievement() const 45achievement database::getRandomAchievement() const
46{ 46{
47 std::string queryString = "SELECT achievements.achievement_id, achievements.game_id, achievements.title, games.moon_image FROM achievements INNER JOIN games ON games.game_id = achievements.game_id ORDER BY RANDOM() LIMIT 1"; 47 std::string queryString = "SELECT achievements.achievement_id, achievements.game_id, achievements.title, games.color FROM achievements INNER JOIN games ON games.game_id = achievements.game_id ORDER BY RANDOM() LIMIT 1";
48 48
49 sqlite3_stmt* ppstmt; 49 sqlite3_stmt* ppstmt;
50 if (sqlite3_prepare_v2( 50 if (sqlite3_prepare_v2(
@@ -73,7 +73,7 @@ achievement database::getRandomAchievement() const
73 result.achievementId = sqlite3_column_int(ppstmt, 0); 73 result.achievementId = sqlite3_column_int(ppstmt, 0);
74 result.gameId = sqlite3_column_int(ppstmt, 1); 74 result.gameId = sqlite3_column_int(ppstmt, 1);
75 result.title = reinterpret_cast<const char*>(sqlite3_column_text(ppstmt, 2)); 75 result.title = reinterpret_cast<const char*>(sqlite3_column_text(ppstmt, 2));
76 result.moonImage = reinterpret_cast<const char*>(sqlite3_column_text(ppstmt, 3)); 76 result.color = reinterpret_cast<const char*>(sqlite3_column_text(ppstmt, 3));
77 77
78 sqlite3_finalize(ppstmt); 78 sqlite3_finalize(ppstmt);
79 79