php - Try & catch pdo close database connection -


try{     //pdo connect db, $db  }catch(pdoexception $e){die("error"));} 

i have query user pdo connect database.

i use try & catch, question if query error

do need close conncetion before die();?

}catch(pdoexception $e){$db="null"; die("error"));} 

no, not necessary in php. when php process finished, connection closed too.


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -