Skip to content

Commit

Permalink
Fix Loading simulator db on some laptop
Browse files Browse the repository at this point in the history
  • Loading branch information
prinx committed Nov 23, 2020
1 parent c89f29d commit 0c09f50
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/libs/Simulator.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,19 @@ public static function retrieveSavedUssdEndpoints()

try {
$db = DB::load($params);
} catch (\Throwable $th) {
return [];
}

$ussdTable = env('USSD_ENDPOINT_DB_TABLE', '');
$numUssdEnpointsToRetrieve = env('USSD_ENDPOINT_NUM_TO_RETRIEVE', 300);
$ussdTable = env('USSD_ENDPOINT_DB_TABLE', '');
$numUssdEnpointsToRetrieve = env('USSD_ENDPOINT_NUM_TO_RETRIEVE', 300);

$stmt = $db->prepare("SELECT * FROM `$ussdTable` ORDER BY id DESC LIMIT :to_retrieve");
$stmt->bindParam('to_retrieve', $numUssdEnpointsToRetrieve, \PDO::PARAM_INT);
$stmt->execute();
$result = $stmt->fetchAll(\PDO::FETCH_ASSOC);
$stmt = $db->prepare("SELECT * FROM `$ussdTable` ORDER BY id DESC LIMIT :to_retrieve");
$stmt->bindParam('to_retrieve', $numUssdEnpointsToRetrieve, \PDO::PARAM_INT);
$stmt->execute();
$result = $stmt->fetchAll(\PDO::FETCH_ASSOC);

return $result;
return $result;
} catch (\Throwable $th) {
return [];
}
}

/**
Expand Down

0 comments on commit 0c09f50

Please sign in to comment.