Skip to content

Instantly share code, notes, and snippets.

@makamo
Created January 26, 2015 15:28
Show Gist options
  • Save makamo/e789d9f84a4c40382349 to your computer and use it in GitHub Desktop.
Save makamo/e789d9f84a4c40382349 to your computer and use it in GitHub Desktop.
<?php
namespace App\Connection;
class Connection {
public $Error;
public $Connection;
public $dataSourceName = "odbc:boreal";
public function _construct(){
try{
$this->Connection = new \PDO($this->dataSourceName);
$this->Connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}catch(PDOException $e){
$this->Error = $e->getMessage();
}
}
public function query($req){
return $this->Connection->query($req);
}
}
@makamo
Copy link
Author

makamo commented Jan 26, 2015

voici le resultat du var_dump

object(App\Connection\Connection)[2]
  public 'Error' => null
  public 'Connection' => null
  public 'dataSourceName' => string 'odbc:boreal' (length=11)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment