I am using pdo method to connect to the MySQL databases via PHP.
Here are the steps that my page is written to execute. 1) open connection 2) run queries 1 3) run queries 2 4) run queries 3 5) close connection.
Now if I want to redirect a user to a different page using "header('Location new_page.php')" function after step 3 will the connection to the database be auto close since the user left the page? or do I need to close the connection manually before the transfer happens?
thanks
header
withdie
orexit
, then not... step 4 will be execute too... – vp_arthPDO::ATTR_PERSISTENT
, then your connection not closed after php execution end, and will reused by next pdo connects – vp_arth