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

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

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

javascript - storing input from prompt in array and displaying the array -