Source for file INFA_OCSP_DBOBJ.phpclass
Documentation is available at INFA_OCSP_DBOBJ.phpclass
* interface file INFA_OCSP_DBOBJ.phpclass
* @project Open CSP-Management
* @author Peter Krebs <pitlinz@sourceforge.net>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* interface to handle a database connection object
* @project Open CSP-Management
* @author Peter Krebs <pitlinz@sourceforge.net>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
// ------------------------------------------------------
// ------------------------------------------------------
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
* checks if a table exists
* @param string $aTable table name
* @param boolean $debug since pk-03-10-24
public function tblExists($aTable,$debug=
False);
// ------------------------------------------------------
// ------------------------------------------------------
* generates a query and returns an array of the resultset
* limit <> a multidimensional array is returned (see queryArray)
* if limit = 1 a single array is returned (see quickQuery)
* if the column starts with a ? the value is assumed to be an sql statement
* if the column starts with a ~ a like condition is created
* else column=slashedvalue(value) is added to the query
* @param string $aTable (the table name)
* @param array $conditions (array(COLUMN => VALUE)) if VALUE does not starts with a '¿' t
* @param int $limit (0 is unlimeted)
* @param string $orderBy (comma seperated list of fields to order)
public function getArray($aTable,$conditions=
NULL,$offset=
0,$limit=
0,$orderBy=
"",$debug=
FALSE);
* returns (a column) of the first row match
* if $colNr > -1 the column value at position $colNr in
* the select statement is returned (NOTE: index starts at 0)
* if $colNr < 0 a array is returend
* if $usNames the DB-column names are the index otherwise
* the index of the returned are is the number in the select order
* @param boolean $withErrMsg
* @param boolean $useNames
* @param boolean $secMode
public function quickQuery($aQuery,$colNr=-
1,$withErrMsg=
False,$useNames=
True,$secMode=
True,$debug=
False);
// ------------------------------------------------------
// data manipulation methods
// ------------------------------------------------------
* inserts a valueArr into the table
* inserts a new row out of an array
* returns the value of the auto_increment field or TRUE
* in case of an error it returns FALSE
* @param string $table name of the table to insert
* @param array $valueArr key=>value array
* @param boolean $debug show debug information
* @returns int key of auto-key or TRUE on success FALSE in case of error
public function insertArray($table,$valueArr,$debug=
FALSE,$idFld=
"");
* replace existing row or insert now if not exists
* inserts a row or update an existing row
* all existing values not in $valueArr (assoc)
* will be handeld by db spezifaction
* see mysql Doc: {@link http://www.mysql.com/doc/en/REPLACE.html}
* @param string $table name of the DBTABLE
* @param array $valueArr value array with FIELDNAME as Index
* @param boolean $debug show debug information
* @returns bool TRUE on success FALSE in case of error
public function replaceArray($table,&$valueArr,$debug=
FALSE);
* updates $values in $aTable where $conditions
* @param array $conditions
* @return int number of effekted rows
function updateArray($aTable,$conditions,$values,$limit =
0,$debug =
false);
* deletes an existing row where the primary key must be set in $valueArr
* @param string $table name of the DBTABLE
* @param array $valueArr value array with FIELDNAME as Index
* @param boolean $debug show debug information
* @returns bool TRUE on success FALSE in case of error
public function deleteArray($table,&$valueArr,$debug=
FALSE);
// ------------------------------------------------------
// where condition functions
// ------------------------------------------------------
* returns $aValue with slashes to use to create query strings
* returns a sql statement for use in search
* @param string $searchStr
* @param boolean $toUpper convert the searchStr to upper cases or leave it as is
* @param boolean $inline enclose the searchStr in placeholders (%search%)
public function qs_getLikeStmt($searchStr,$toUpper=
FALSE,$inline=
TRUE,$debug=
FALSE);
Documentation generated on Thu, 08 Jan 2009 17:44:28 +0100 by phpDocumentor 1.4.0a2