Skip to content

Commit

Permalink
Fix errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
herloct committed Oct 18, 2016
1 parent 0a3ab00 commit 5a7dd28
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions frameworks/PHP/slim/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
// Test 5: Database updates
$app->get('/updates', function ($request, $response) {
$sth = $this->db->prepare('SELECT * FROM world WHERE id = ?');
$sthUpdate = $this->db->prepare('UPDATE world SET randomNumber = ? WHERE id = ?');

$queries = max(1, min($request->getParam('queries'), 500));
$worlds = [];
Expand All @@ -76,11 +77,9 @@
'randomNumber' => (int) $row['randomNumber']
];
$world['randomNumber'] = mt_rand(1, 10000);

$sthUpdate = $this->db->prepare('UPDATE TABLE world SET randomNumber = ? WHERE id = ?');
$sth->execute([$world['randomNumber'], $world['id']]);

$worlds[] = $world;

$sthUpdate->execute([$world['randomNumber'], $world['id']]);
}

return $response
Expand Down

0 comments on commit 5a7dd28

Please sign in to comment.