/database.global.php

Description

Global framework functions

Functions
dbCount
void dbCount ( $pTable, [ $pWhere = false])
  • $pTable
  • $pWhere
dbDelete

Deletes rows from the table based on the pWhere

void dbDelete (type $pTable, [type $pWhere = false])
  • type $pTable: The table name based on your extension table definition
  • type $pWhere: Do not forget this, otherwise the table will be truncated.
dbError
void dbError ()
dbExec

Execute a query and return the resultset

array dbExec (string $pSql)
  • string $pSql
dbExfetch

Execute a query and return the items

array dbExfetch (string $pSql, [integer $pRowCount = 1], [type $pMode = PDO::FETCH_ASSOC])
  • string $pSql: The SQL
  • integer $pRowCount: How much rows you want. Use -1 for all, with 1 you'll get direct the array without a list.
  • type $pMode: Obsolete
dbFetch

Fetch a row based on the specified Resultset from dbExec()

type dbFetch (type $pRes, [type $pCount = 1], [type $pMode = PDO::FETCH_ASSOC])
  • type $pRes: The result of dbExec()
  • type $pCount: Defines how many items the function returns
  • type $pMode: Obsolete
dbInsert

Inserts the values based on pFields into the table pTable.

  • return: The last_insert_id() (if you use auto_increment/sequences)
integer dbInsert (string $pTable, array $pFields)
  • string $pTable: The table name based on your extension table definition
  • array $pFields: Array as a key-value pair. key is the column name and the value is the value. More infos under http://www.kryn.org/docu/developer/framework-database
dbTableFetch

Select items based on pWhere on table pTable and returns pCount items.

type dbTableFetch (string $pTable, [integer $pCount = -1], [string $pWhere = false], [type $pMode = PDO::FETCH_ASSOC])
  • string $pTable: The table name based on your extension table definition.
  • integer $pCount: How many items it will returns, with 1 you'll get direct the array without a list.
  • string $pWhere
  • type $pMode: obsolete
dbTableLang
void dbTableLang ( $pTable, [ $pCount = -1], [ $pWhere = false])
  • $pTable
  • $pCount
  • $pWhere
dbToKeyIndex
void dbToKeyIndex ( &$pItems,  $pIndex)
  • &$pItems
  • $pIndex
dbUpdate

Update a row or rows with the values based on pFields into the table pTable.

type dbUpdate (string $pTable, string|array $pPrimary, array $pFields)
  • string $pTable: The table name based on your extension table definition
  • string|array $pPrimary: Define the limitation as a SQL or as a array ('field' => 'value')
  • array $pFields: Array as a key-value pair. key is the column name and the value is the value. More infos under http://www.kryn.org/docu/developer/framework-database
esc

Escape a string for usage in SQL.

Depending on the current database this functions choose the proper escape function.

  • return: Escaped string
string esc (string $p)
  • string $p

Documentation generated on Tue, 18 Jan 2011 23:34:38 +0100 by phpDocumentor 1.4.3