aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/poche/Database.class.php
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2015-02-16 15:18:24 +0100
committerThomas Citharel <tcit@tcit.fr>2015-02-16 15:18:24 +0100
commitcdee5e65701330e0b740640f471228d8b9b02a91 (patch)
tree90d0c1a6099738a3bd063b2cdd3eaa9c4315a4e6 /inc/poche/Database.class.php
parent467503fb2ad5904d9c4ef54bf20218937081f3a2 (diff)
downloadwallabag-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-xinc/poche/Database.class.php12
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