|
|
|
XName -
Db
Db
Generic interface for DB access. Currently supports mysql only
|
public class Db
Generic interface for DB access. Currently supports mysql only
|
| |
|
|
|
|
|
|
|
Public Method Details |
Db |
|
public object DB Db( object Config $config )
|
| |
Class constructor. Connects to DB
|
| Parameter |
|
| object Config |
$config |
|
|
Config object |
|
| Returns |
object DB database object |
|
query |
|
public object query query( string $string )
|
| |
Pass query to DB
|
| Parameter |
|
|
| Returns |
object query handler |
|
fetch_row |
|
public array fetch_row( object Query $res )
|
| |
Fetch next row from query handler
|
| Parameter |
|
| object Query |
$res |
|
|
query handler |
|
| Returns |
array next result row |
|
affected_rows |
|
public int affected_rows( object Query $res )
|
| |
Returns number of affected rows by given query handler
|
| Parameter |
|
| object Query |
$res |
|
|
query handler |
|
| Returns |
int number of affected rows |
|
free |
|
public int free( )
|
| |
Free current db handlers - query & results
|
| Returns |
int 0 |
|
error |
|
public int error( )
|
| |
Check if an error occured, & take action
|
| Returns |
int 1 if error, 0 else |
|
|
Private Method Details |
connect |
|
private object Db connect( string $host, string $user, string $pass, string $db )
|
| |
Do simple connect
|
| Parameter |
|
| string |
$host |
|
|
hostname or IP of DB host |
|
|
| string |
$user |
|
|
username for db access |
|
|
| string |
$pass |
|
|
password for db access |
|
|
|
| Returns |
object Db database handler |
|
pconnect |
|
private object Db pconnect( string $host, string $user, string $pass, string $db )
|
| |
Do permanent connect
|
| Parameter |
|
| string |
$host |
|
|
hostname or IP of DB host |
|
|
| string |
$user |
|
|
username for db access |
|
|
| string |
$pass |
|
|
password for db access |
|
|
|
| Returns |
object Db database handler |
|
|
Private Field Details |
$dbh |
|
private unknown $dbh
>><<
|
|
$result |
|
private unknown $result
>><<
|
|
$config |
|
private unknown $config
>><<
|
|
|
|
|
|
| PHPDoc 1.0beta |