Parameter |
Default |
Description |
Global variables |
$gStateQueryCount |
0 |
Database query count. |
$gStateQueryTime |
0 |
Counter of database query execution time. |
$gStateLastQueryTime |
0 |
The counter of the last query execution time for the database. |
$gDbNick |
<blank>. |
Prefix in table names. |
MySql ($mErrorReportFunc) |
Class constructor, returns a pointer. |
$mErrorReportFunc. |
The name of the function to be called in case of a system error. The function must have four input parameters: error type, error file, error message, additional information about the error. |
Connect ($mOwner, $mLine, $mHostName, $mUserName, $mUserPass, $mDbName, $mDbCommand, $mDbNick, $mDbCharset) |
Connection to the database. If successful, returns true. |
$mOwner |
|
The name of the file that initializes the connection. Used to display an error message. |
$mLine |
|
The line number of the file from which the command is executed. Used to display an error message. |
$mHostName |
DB_HOST_NAME |
The name of the server. |
$mUserName |
DB_USER_NAME |
The name of the user. |
$mUserPass |
DB_USER_PASS |
User's password. |
$mDbName |
DB_NAME |
The name of the database. |
$mDbCommand |
DB_COMMAND |
A set of SQL queries that are executed immediately after connecting to the database. |
$mDbNick |
DB_NICK |
Prefix in table names. |
$mDbCharset |
DB_CHARSET |
The name of the encoding in which data will be exchanged with the database. |
DoQuery ($mOwner, $mLine, $mCommand) |
Execute the SQL query. Returns the query pointer. |
$mOwner |
|
The name of the file that initializes the connection. Used to display an error message. |
$mLine |
|
The line number of the file from which the command is executed. Used to display an error message. |
$mCommand |
|
The text of the SQL query. |
GetNumRows ($mQuery) |
Get the number of rows from the result of the SQL query. |
$mQuery |
|
The pointer of the SQL query. |
GetNumFields ($mQuery) |
Get the number of fields from the SQL query result. |
GetFieldName ($mQuery, $mColNum) |
Get the name of one of the fields from the SQL query result. |
$mQuery | | The pointer of the SQL query. |
$mColNum | | Field number, numbering starts from zero. |
FetchHash ($mQuery) |
Returns an associative array of type "field name->field value" for the current row from the SQL query result. If there are no more rows, it returns false. After the query is executed, it moves to the next row. |
$mQuery | | The pointer of the SQL query. |
FetchRow ($mQuery) |
Returns a numbered array with field values for the current row from the SQL query result. If there are no more rows, it returns false. After the query is executed, the next row is moved to the next one. |
$mQuery | | The pointer of the SQL query. |
DataSeek ($mQuery, $mPos) |
Moves to the specified row as a result of the SQL query. |
$mQuery |
|
SQL query pointer. |
$mPos | | Row number, numbering starts from zero. |
GetAffectedRows() |
Returns the number of affected rows as a result of the last SQL query. |