PHP Class DByte\DB

显示文件 Open project: xeoncross/dbyte Class Usage Examples

Public Properties

Property Type Description
$c
$i
$p
$q

Public Methods

Method Description
column ( string $query, array $params = NULL, integer $key ) : array | null Fetch a column offset from the result set (COUNT() queries)
fetch ( string $query, array $params = NULL, integer $column = NULL ) : array Fetch all query result rows
insert ( string $table, array $data ) : integer | null Insert a row into the database
pairs ( string $query, array $params = NULL ) : array Fetches an associative array of all rows as key-value pairs (first column is the key, second column is the value).
query ( string $query, array $params = NULL ) : object | null Prepare and send a query returning the PDOStatement
row ( string $query, array $params = NULL ) : mixed Fetch a single query result row
update ( string $table, array $data, $value, $column = 'id' ) : integer | null Update a database row

Method Details

column() static public method

Fetch a column offset from the result set (COUNT() queries)
static public column ( string $query, array $params = NULL, integer $key ) : array | null
$query string query string
$params array query parameters
$key integer index of column offset
return array | null

fetch() static public method

Fetch all query result rows
static public fetch ( string $query, array $params = NULL, integer $column = NULL ) : array
$query string query string
$params array query parameters
$column integer the optional column to return
return array

insert() static public method

Insert a row into the database
static public insert ( string $table, array $data ) : integer | null
$table string name
$data array
return integer | null

pairs() static public method

Fetches an associative array of all rows as key-value pairs (first column is the key, second column is the value).
static public pairs ( string $query, array $params = NULL ) : array
$query string query string
$params array query parameters
return array

query() static public method

Prepare and send a query returning the PDOStatement
static public query ( string $query, array $params = NULL ) : object | null
$query string query string
$params array query parameters
return object | null

row() static public method

Fetch a single query result row
static public row ( string $query, array $params = NULL ) : mixed
$query string query string
$params array query parameters
return mixed

update() static public method

Update a database row
static public update ( string $table, array $data, $value, $column = 'id' ) : integer | null
$table string name
$data array
return integer | null

Property Details

$c static_oe public_oe property

static public $c

$i static_oe public_oe property

static public $i

$p static_oe public_oe property

static public $p

$q static_oe public_oe property

static public $q