What happens when a script with following code is included into another php script, does it create a new PDO object every time..?? If yes, then how can i use a single PDO object created once throughout multiple php scripts..?? I don't want to use persistent connections..
try{
$dsn = 'mysql:host=localhost;dbname=test';
$username = 'user';
$password = 'password';
$conn = new PDO($dsn, $username, $password);
$conn ->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch(PDOException $e) {
echo 'ERROR: '. $e->getMessage();
}