Method: db::row
Returns a single row from a table
Info
Syntax
db::row($table, $select='*', $where=null, $order=null)
Parameters
- $table (string) The table name
- $select (mixed) Either an array of fields or a MySQL string of fields
- $where (mixed) Either a key/value array as AND connected where clause or a simple MySQL where clause string
- $order (string) Order clause without the order keyword. ie: "added desc"
Return (mixed)
Example
$user = db::row('user', '*', array('id' => 1));
// sample result: array(
// 'id' => 1,
// 'username' => 'bastian',
// 'email' => 'mail@bastian-allgeier.de'
// );
$user = db::row('user', 'username', array('id' => 1));
// sample result: array(
// 'username' => 'bastian'
// );