It seems that for an INSERT statement, one can use if (isset($connect->lastInsertId()))
in order to check whether the INSERT statement was successful. (Please correct me if I'm wrong.)
But for an UPDATE statement, how can I know if it was successful?
For example, I have basic one like that:
$statement=$connect->prepare("UPDATE users SET premium='1' WHERE userid=?");
$statement->execute(array($id));
Thanks a lot in advance. Regards
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…