jeudi 20 septembre 2018

What does if($stmt) mean here?

I have started learning PHP since 4 days. I found this code online while i was searching for "Best practice to execute MySQL query in PHP". I can't determine , What does he use if($stmt) for ?

$stmt = $condb->prepare("DELETE FROM accounts WHERE id=:id");
$stmt->execute(
array(
"id" => 5
)
);

if($stmt){
   // Do Something
} else {
   // Do Something Else
}

Aucun commentaire:

Enregistrer un commentaire