[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 89
  • Last Modified:

Closing database connection after prepared statement

I just wanted to know if it is necessary to close the database connection after using a prepared statement?

Something like:

$stmt->execute();
$stmt->close();
$link->close();

Open in new window

0
Black Sulfur
Asked:
Black Sulfur
1 Solution
 
Ray PaseurCommented:
No.  It's never necessary.  The script termination / garbage collection process will close the connection for you.  Examples here:
https://www.experts-exchange.com/articles/11177/PHP-MySQL-Deprecated-as-of-PHP-5-5-0.html
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now