Packageindex Classtrees Modulegroups Elementlist Report XML Files

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 Summary

object DB

Db(object Config $config)

Class constructor. Connects to DB
object query

query(string $string)

Pass query to DB
array

fetch_row(object Query $res)

Fetch next row from query handler
int

affected_rows(object Query $res)

Returns number of affected rows by given query handler
int

free()

Free current db handlers - query & results
int

error()

Check if an error occured, & take action

Private Method Summary

object Db

connect(string $host, string $user, string $pass, string $db)

Do simple connect
object Db

pconnect(string $host, string $user, string $pass, string $db)

Do permanent connect

Private Field Summary

unknown

$dbh

unknown

$result

unknown

$config

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
string $string
QUERY
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
string $db
database name
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
string $db
database name
Returns object Db

database handler


Private Field Details

$dbh

private unknown $dbh

>><<



$result

private unknown $result

>><<



$config

private unknown $config

>><<




Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta