PHP PDO close()?
Posted
by
PHPLOVER
on Stack Overflow
See other posts from Stack Overflow
or by PHPLOVER
Published on 2012-04-14T23:25:01Z
Indexed on
2012/04/14
23:29 UTC
Read the original article
Hit count: 295
Can someone tell me, when you for example update, insert, delete.. should you then close it like $stmt->close();
? i checked php manual and don't understand what close() actually does.
EXAMPLE:
$stmt = $dbh->prepare("SELECT `user_email` FROM `users` WHERE `user_email` = ? LIMIT 1");
$stmt->execute(array($email));
$stmt->close();
Next part of my question is, if as an example i had multiple update queries in a transaction after every execute()
for each query i am executing should i close them individually ? ... because it's a transaction not sure i need to use $stmt->close();
after each execute(); or just use one $stmt->close();
after all of them ?
Thanks once again,
phplover
© Stack Overflow or respective owner