\qfq Db

Summary

Methods
Properties
Constants
__construct()
set_fr_error()
doQuery()
doQueryKeys()
selectDB()
openDB()
closeAllDB()
$t3_typo_db_host
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$lastUsedDB
$arrDB
$t3_typo_db_username
$t3_typo_db
$t3_typo_db_password
$log
$fr_error
N/A

Properties

$t3_typo_db_host

$t3_typo_db_host : 

Type

$lastUsedDB

$lastUsedDB : string

Type

string

$arrDB

$arrDB : array

Type

array

$t3_typo_db_username

$t3_typo_db_username : 

Type

$t3_typo_db

$t3_typo_db : 

Type

$t3_typo_db_password

$t3_typo_db_password : 

Type

$fr_error

$fr_error : 

Type

Methods

__construct()

__construct(  $log) 

Constructor:

Parameters

$log

set_fr_error()

set_fr_error(array  $fr_error) 

Set Array fr_error: setter function to set most recent values, especially fr_erro['row'].

Will be shown in error messages.

Parameters

array $fr_error

uid, pid, row, column_idx, full_level

doQuery()

doQuery(string  $dbAlias, string  $sql, array  $result,   $expect = ROW_REGULAR, string  $merge = MERGE_NONE) : boolean

doQueryKeys: See doQuery Difference: fake Array for $keys

Parameters

string $dbAlias
string $sql
array $result
$expect
string $merge

Throws

\qfq\CodeReportException
\qfq\SqlReportException
\qfq\SyntaxReportException

Returns

boolean

doQueryKeys()

doQueryKeys(string  $dbAlias, string  $sql, array  $result, array  $keys, string  $expect = ROW_REGULAR, string  $merge = MERGE_NONE, integer  $arrayMode = MYSQL_NUM) : boolean

doQueryKeys: fires a show, select, insert, update or delete and collects result.

insert, update and delete will produce a log entry. If: $expect==EXPECT_SQL_OR_STRING, '$sql' can be anything which won't be fired if it's not a SQL statement.

Parameters

string $dbAlias

Name of Database to be used.

string $sql

Select Query

array $result

content depends on $sql. $sql='insert ...': mysql_last_insert_id will be returned in $result. $sql='update ...' or 'delete ----': mysql_affected_rows will be returned in $result. $sql='select ...': all selected rows will be returned in $result. $result will be formatted like specified in $merge. Attention: with EXPECT_1|EXPECT_0_1 '$result' is a one dimensional array, else a two dimensional array.

array $keys
string $expect
string $merge

Applies different modes of merging - MERGE_NONE, MERGE_ROW, MERGE_ALL

integer $arrayMode

Throws

\qfq\CodeReportException
\qfq\SqlReportException
\qfq\SyntaxReportException

Returns

boolean —

true: all ok false: a) Number of rows don't match $expect b) $expect==EXPECT_SQL_OR_STRING and $sql is not an SQL expression (instead it's a regular string) - this is not bad, just to indicate that there was no query.

selectDB()

selectDB(string  $dbAlias) : boolean

select DB

Parameters

string $dbAlias

: Name of the dbname

Returns

boolean —

TRUE if ok, else exception.

openDB()

openDB(string  $dbAlias) 

Open specified DB

Parameters

string $dbAlias

Name of database to be opened

Throws

\qfq\SqlReportException

closeAllDB()

closeAllDB() : void

closeAllDB