$id = 1;
$dbh = new PDO($connectionString, $user, $password);
$sql = ' SELECT column';
$sql .= ' FROM table';
$sql .= ' WHERE id = :id';
$stmt = $dbh->prepare($sql);
$stmt->bindParam(':id', $id);
if($stmt->execute()) {
// Do stuff
}
//This echos ID: 1
echo "ID: $id";
if($id === 1) {
echo 'This should be true, we set $id = 1 at the top.';
} else {
echo 'Instead we get here because PDO casually changed our variable into a string and "1" != 1.';
die('in a fire dynamic typing.');
}
If you buy a phone or tablet from anyone that isn't Apple you will very likely get a USB port. If you buy Apple you will not. Trying to argue that Apple is somehow looking to the future by providing a serial bus years after it was the norm is hard to comprehend.