例如,当我使用 try catch 块时:
try{
require_once('../php/connect.php');
$dbh = db::getInstance();
// What i am trying to understand should i close the connection here before the header?
header("Location: x.php");
}
} catch(PDOException $e){
require_once('err.php');
}
$dbh = null; // Or should i close the connection here?
是“翻译”甚至在第“5”行之后,谢谢大家,祝你有美好的一天。