Changing all $db to $pdo, oops.