• Edit
  • Delete

PHP Cheat Sheet

Apache Config Options / .htaccess

error_reporting calculator:

 

PDO

Nice PDO Info

https://phpdelusions.net/pdo

Reuse of query

$data = [
 1 => 1000,
 5 =>  300,
 9 =>  200,
];
$stmt = $pdo->prepare('UPDATE users SET bonus = bonus + ? WHERE id = ?');
foreach ($data as $id => $bonus) {
 $stmt->execute([$bonus, $id]);
}