diff options
author | Thomas Citharel <tcit@tcit.fr> | 2015-02-16 15:18:24 +0100 |
---|---|---|
committer | Thomas Citharel <tcit@tcit.fr> | 2015-02-16 15:18:24 +0100 |
commit | cdee5e65701330e0b740640f471228d8b9b02a91 (patch) | |
tree | 90d0c1a6099738a3bd063b2cdd3eaa9c4315a4e6 /inc/poche/Database.class.php | |
parent | 467503fb2ad5904d9c4ef54bf20218937081f3a2 (diff) | |
download | wallabag-cdee5e65701330e0b740640f471228d8b9b02a91.tar.gz wallabag-cdee5e65701330e0b740640f471228d8b9b02a91.tar.zst wallabag-cdee5e65701330e0b740640f471228d8b9b02a91.zip |
much better fix for #10821.9RC1
Diffstat (limited to 'inc/poche/Database.class.php')
-rwxr-xr-x | inc/poche/Database.class.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php index 210ebb74..65675afe 100755 --- a/inc/poche/Database.class.php +++ b/inc/poche/Database.class.php | |||
@@ -411,12 +411,14 @@ class Database { | |||
411 | 411 | ||
412 | return $count; | 412 | return $count; |
413 | } | 413 | } |
414 | public function getRandomId($row, $user_id) { | 414 | public function getRandomId($user_id) { |
415 | $sql = "SELECT id FROM entries WHERE user_id=? LIMIT 1 OFFSET ? "; | 415 | $random = (STORAGE == 'mysql') ? 'RAND()' : 'RANDOM()'; |
416 | $params = array($user_id, $row); | 416 | $sql = "SELECT id FROM entries WHERE user_id=? ORDER BY ". $random . " LIMIT 1"; |
417 | $query = $this->executeQuery($sql, $params); | 417 | $params = array($user_id); |
418 | $query = $this->executeQuery($sql, $params); | ||
419 | $id = $query->fetchAll(); | ||
418 | 420 | ||
419 | return $query->fetchAll(); | 421 | return $id; |
420 | } | 422 | } |
421 | 423 | ||
422 | 424 | ||