Skip to content

Instantly share code, notes, and snippets.

@okaprinarjaya
Created July 10, 2012 13:42
Show Gist options
  • Save okaprinarjaya/3083314 to your computer and use it in GitHub Desktop.
Save okaprinarjaya/3083314 to your computer and use it in GitHub Desktop.
<?php
class Model {
private $DBConnection = null;
private $DBHandler = null;
public function getConnection() {
try {
$this->DBConnection = new DBConnection(DBConfig::connInfo());
$this->DBHandler = $this->DBConnection->connect();
} catch (PDOException $PDOExcp) {
echo $PDOExcp->getMessage();
$PDOExcp->getTrace();
} catch (Exception $excp) {
echo $excp->getMessage();
$excp->getTrace();
}
return $this->DBHandler;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment