View | Details | Raw Unified | Return to bug 11279
Collapse All | Expand All

(-)a/C4/Koha.pm (-4 / +3 lines)
Lines 1443-1453 sub GetDailyQuote { Link Here
1443
        my $range = ($sth->fetchrow_array)[0];
1443
        my $range = ($sth->fetchrow_array)[0];
1444
        if ($range > 1) {
1444
        if ($range > 1) {
1445
            # chose a random id within that range if there is more than one quote
1445
            # chose a random id within that range if there is more than one quote
1446
            my $id = int(rand($range));
1446
            my $offset = int(rand($range));
1447
            # grab it
1447
            # grab it
1448
            $query = 'SELECT * FROM quotes WHERE id = ?;';
1448
            $query = 'SELECT * FROM quotes ORDER BY id LIMIT ?, 1;';
1449
            $sth = C4::Context->dbh->prepare($query);
1449
            $sth = C4::Context->dbh->prepare($query);
1450
            $sth->execute($id);
1450
            $sth->execute($offset);
1451
        }
1451
        }
1452
        else {
1452
        else {
1453
            $query = 'SELECT * FROM quotes;';
1453
            $query = 'SELECT * FROM quotes;';
1454
- 

Return to bug 11279