samples/PhotoAlbum/lib/rb.php
public function connect() {
		if ($this->isConnected) return;
		$user = $this->connectInfo['user'];
		$pass = $this->connectInfo['pass'];
		//PDO::MYSQL_ATTR_INIT_COMMAND
		$this->pdo = new PDO(
				  $this->dsn,
				  $user,
				  $pass,
				  array(1002 => 'SET NAMES utf8',
							 PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
							 PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,

				  )
		);
		$this->pdo->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, true);
		$this->isConnected = true;
	}
public function connect() {
		if ($this->isConnected) return;
		$user = $this->connectInfo['user'];
		$pass = $this->connectInfo['pass'];
		//PDO::MYSQL_ATTR_INIT_COMMAND
		$this->pdo = new PDO(
				  $this->dsn,
				  $user,
				  $pass,
				  array(1002 => 'SET NAMES utf8',
							 PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
							 PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,

				  )
		);
		$this->pdo->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, true);
		$this->isConnected = true;
	}
public function connect ( ) { if ( $ this -> isConnected ) return ; $ user = $ this -> connectInfo [ 'user' ] ; $ pass = $ this -> connectInfo [ 'pass' ] ; //PDO::MYSQL_ATTR_INIT_COMMAND $ this -> pdo = new PDO ( $ this -> dsn , $ user , $ pass , array ( 1002 => 'SET NAMES utf8' , PDO :: ATTR_ERRMODE => PDO :: ERRMODE_EXCEPTION , PDO :: ATTR_DEFAULT_FETCH_MODE => PDO :: FETCH_ASSOC , ) ) ; $ this -> pdo -> setAttribute ( PDO :: ATTR_STRINGIFY_FETCHES , true ) ; $ this -> isConnected = true ; }
Establishes a connection to the database using PHP PDO
functionality. If a connection has already been established this
method will simply return directly. This method also turns on
UTF8 for the database and PDO-ERRMODE-EXCEPTION as well as
PDO-FETCH-ASSOC.

@return void
Establishes a connection to the database using PHP PDO functionality . If a connection has already been established this method will simply return directly . This method also turns on UTF8 for the database and PDO - ERRMODE - EXCEPTION as well as PDO - FETCH - ASSOC .