Ejemplo n.º 1
0
 /**
  * Open a connection to MySQLi server
  *
  * @param none
  * @return Object $this
  */
 public function getConnection(DatabaseBean $bean)
 {
     $this->conn = @mysql_connect($bean->getHost(), $bean->getUser(), $bean->getPass());
     $this->sqlDB = $bean->getDb();
     $this->selectDB();
     return $this;
 }
Ejemplo n.º 2
0
 /**
  * Open a connection to MySQLi server
  *
  * @param none
  * @return Object $this
  */
 public function getConnection(DatabaseBean $bean)
 {
     $this->conn = new \mysqli($bean->getHost(), $bean->getUser(), $bean->getPass(), $bean->getDb());
     return $this;
 }
Ejemplo n.º 3
0
 /**
  * Method for connecting to database
  *
  * @param none
  * @return void
  */
 public function getConnection(DatabaseBean $bean)
 {
     $this->pdoObject = new \PDO($bean->getDbType() . ":host=" . $bean->getHost() . ";dbname=" . $bean->getDb() . ";charset=utf8", $bean->getUser(), $bean->getPass(), array(PDO::ATTR_EMULATE_PREPARES => false, PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
 }