alternative random function to fix #1082

This commit is contained in:
Thomas Citharel
2015-02-16 00:43:18 +01:00
parent d523c99399
commit 6b60741600
2 changed files with 13 additions and 6 deletions

View File

@ -411,6 +411,14 @@ class Database {
return $count;
}
public function getRandomId($row, $user_id) {
$sql = "SELECT id FROM entries WHERE user_id=? LIMIT 1 OFFSET ? ";
$params = array($user_id, $row);
$query = $this->executeQuery($sql, $params);
return $query->fetchAll();
}
public function updateContent($id, $content, $user_id)
{