PHP 클래스 PHPFusion\Database\Driver\PDOMySQL

상속: extends PHPFusion\Database\AbstractDatabaseDriver
파일 보기 프로젝트 열기: php-fusion/PHP-Fusion

공개 메소드들

메소드 설명
_query ( string $query, array $parameters = [] ) : PDOStatement Send a database query
close ( ) Close the connection
count ( string $field, string $table, string $conditions = "", array $parameters = [] ) : integer Count the number of rows in a table filtered by conditions
countRows ( PDOStatement $statement ) : integer Count the number of affected rows by the given query
fetchAssoc ( PDOStatement $statement ) : array Fetch one row as an associative array
fetchFirstColumn ( PDOStatement $statement, integer $row ) : mixed Fetch the first column of a specific row
fetchRow ( PDOStatement $statement ) : array Fetch one row as a numeric array
getLastId ( ) : integer Get the last inserted auto increment id
getServerVersion ( ) : string Get the database server version
isConnected ( ) : boolean
quote ( $value ) : string Implementation of \PDO::quote()

보호된 메소드들

메소드 설명
connect ( string $host, string $user, string $pass, string $db, array $options = [] ) Connect to the database

메소드 상세

_query() 공개 메소드

Send a database query
public _query ( string $query, array $parameters = [] ) : PDOStatement
$query string SQL
$parameters array
리턴 PDOStatement or FALSE on error

close() 공개 메소드

Close the connection
public close ( )

connect() 보호된 메소드

Connect to the database
protected connect ( string $host, string $user, string $pass, string $db, array $options = [] )
$host string Server domain or IP followed by an optional port definition
$user string
$pass string Password
$db string The name of the database
$options array Currently only one option exists: charset

count() 공개 메소드

Count the number of rows in a table filtered by conditions
public count ( string $field, string $table, string $conditions = "", array $parameters = [] ) : integer
$field string Parenthesized field name
$table string Table name
$conditions string conditions after "where"
$parameters array
리턴 integer

countRows() 공개 메소드

Count the number of affected rows by the given query
public countRows ( PDOStatement $statement ) : integer
$statement PDOStatement
리턴 integer

fetchAssoc() 공개 메소드

Fetch one row as an associative array
public fetchAssoc ( PDOStatement $statement ) : array
$statement PDOStatement
리턴 array Associative array

fetchFirstColumn() 공개 메소드

Fetch the first column of a specific row
public fetchFirstColumn ( PDOStatement $statement, integer $row ) : mixed
$statement PDOStatement
$row integer
리턴 mixed

fetchRow() 공개 메소드

Fetch one row as a numeric array
public fetchRow ( PDOStatement $statement ) : array
$statement PDOStatement
리턴 array Numeric array

getLastId() 공개 메소드

Get the last inserted auto increment id
public getLastId ( ) : integer
리턴 integer

getServerVersion() 공개 메소드

Get the database server version
public getServerVersion ( ) : string
리턴 string

isConnected() 공개 메소드

public isConnected ( ) : boolean
리턴 boolean TRUE if the connection is alive

quote() 공개 메소드

Implementation of \PDO::quote()
또한 보기: http://php.net/manual/en/pdo.quote.php
public quote ( $value ) : string
$value
리턴 string