affected affected_rows(
)
|
|
Evaluate the result; which rows were affected by the query.
API Tags:
Redefinition of:
- atkDb::affected_rows()
- Retrieve the number of rows affected by the last query.
Redefined in descendants as:
Disconnect from database
Redefinition of:
- atkDb::disconnect()
- Disconnect from database
Redefined in descendants as:
mixed doConnect(
string
$host, string
$user, string
$password, string
$database, int
$port, string
$charset
)
|
|
Connect to the database
Parameters:
|
string |
$host: |
Hostname |
|
string |
$user: |
Username |
|
string |
$password: |
Password |
|
string |
$database: |
The database to connect to |
|
int |
$port: |
The portnumber to use for connecting |
|
string |
$charset: |
The charset to use |
API Tags:
| Return: | Connection status |
Redefinition of:
- atkDb::doConnect()
- Connect to the database
Redefined in descendants as:
Drop all database tables.
Redefinition of:
- atkDb::dropAll()
- Drop all database tables.
void escapeSQL(
string
$string, [bool
$wildcard = false]
)
|
|
Escaping a MySQL string, in a mysqli safe way
Parameters:
|
string |
$string: |
|
|
bool |
$wildcard: |
|
Redefinition of:
- atkDb::escapeSQL()
- escapes quotes for use in SQL: ' -> '' (and sometimes % -> %%)
Redefined in descendants as:
String func_datetimetochar(
String
$fieldname
)
|
|
Get TO_CHAR() equivalent for the current database.
TODO/FIXME: add format parameter. Current format is always yyyy-mm-dd hh:mi.
Parameters:
|
String |
$fieldname: |
The field to generate the to_char for. |
API Tags:
| Return: | Piece of sql query that converts a datetime field to char for the current database |
Redefinition of:
- atkDb::func_datetimetochar()
- Get TO_CHAR() equivalent for the current database.
String func_datetochar(
String
$fieldname, [String
$format = ""]
)
|
|
Get TO_CHAR() equivalent for the current database.
Each database driver should override this method to perform vendor specific conversion.
Parameters:
|
String |
$fieldname: |
The field to generate the to_char for. |
|
String |
$format: |
Format specifier. The format is compatible with php's date() function (http://www.php.net/date) The default is what's specified by $config_date_to_char, or "Y-m-d" if not set in the configuration. |
API Tags:
| Return: | Piece of sql query that converts a date field to char for the current database |
Redefinition of:
- atkDb::func_datetochar()
- Get TO_CHAR() equivalent for the current database.
false|string getColumnLength(
string
$tableName, string
$columnName, string
$columnType
)
|
|
Mysql_field_len returns unusable results for decimal,float and double column types.
This method returns a number format, e.g.: '6,2' or false in case of failure OR if the field type does not support a floating point (e.g. for integer fields) so it can fall back on mysql_field_len()
Parameters:
|
string |
$tableName: |
|
|
string |
$columnName: |
|
|
string |
$columnType: |
|
API Tags:
| Return: | e.g. '6,2' |
| Access: | public |
Determine whether an error that occurred is a recoverable (user) error or a system error.
API Tags:
| Return: | "user" or "system" |
Redefinition of:
- atkDb::getErrorType()
- Determine whether an error that occurred is a recoverable (user) error or a system error.
This function indicates what searchmodes the database supports.
API Tags:
| Return: | with search modes |
Redefinition of:
- atkDb::getSearchModes()
- This function indicates what searchmodes the database supports.
result lock(
string
$table, [string
$mode = "write"]
)
|
|
Lock a certain table in the database
Parameters:
|
string |
$table: |
the table name |
|
string |
$mode: |
the type of locking |
API Tags:
Redefinition of:
- atkDb::lock()
- Lock a table in the database.
Redefined in descendants as:
void locktables_fallback_on_error(
string
$query, [string
$querymode = 'w']
)
|
|
This method provides a fallback when error 1100 occurs (Table ... not locked using LOCK TABLES). This method locks the table and runs the query again.
Parameters:
|
string |
$query: |
The original query that failed |
|
string |
$querymode: |
Kind of query - 'w' for write or 'r' for read |
Redefined in descendants as:
array metadata(
String
$table, [boolean
$full = false]
)
|
|
Return the meta data of a certain table
Parameters:
|
String |
$table: |
the table name (optionally in 'database.tablename' format) |
|
boolean |
$full: |
all meta data or not |
API Tags:
Redefinition of:
- atkDb::metadata()
- Return the meta data of a certain table HIE GEBLEVEN
Redefined in descendants as:
the nextid(
string
$sequence
)
|
|
Get the next sequence number of a certain sequence.
Parameters:
|
string |
$sequence: |
the sequence name |
API Tags:
Redefinition of:
- atkDb::nextid()
- Get the next sequence number of a certain sequence.
Redefined in descendants as:
Goto the next record in the result set
API Tags:
| Return: | of going to the next record |
Redefinition of:
- atkDb::next_record()
- Retrieve the next record in the resultset.
Redefined in descendants as:
Evaluatie the result; how many fields where affected by the query.
API Tags:
| Return: | of affected fields |
Redefined in descendants as:
Evaluate the result; how many rows were affected by the query.
API Tags:
Redefined in descendants as:
void query(
string
$query, [int
$offset = -1], [int
$limit = -1]
)
|
|
Performs a query
Parameters:
|
string |
$query: |
the query |
|
int |
$offset: |
offset in record list |
|
int |
$limit: |
maximum number of records |
Redefinition of:
- atkDb::query()
- Parse and execute a query.
Redefined in descendants as:
void seek(
[int
$position = 0]
)
|
|
Goto a certain position in result set.
Not specifying a position will set the pointer at the beginning of the result set.
Parameters:
|
int |
$position: |
the position |
Redefined in descendants as:
void setSequenceValue(
string
$seqname, int
$value
)
|
|
Set database sequence value.
Parameters:
|
string |
$seqname: |
sequence name |
|
int |
$value: |
sequence value |
Redefinition of:
- atkDb::setSequenceValue()
- Set database sequence value.
boolean tableExists(
String
$table
)
|
|
This function checks the database for a table with the provide name
Parameters:
|
String |
$table: |
the table to find |
API Tags:
| Return: | true if found, false if not found |
Redefinition of:
- atkDb::tableExists()
- This function checks the database for a table with the provide name
Redefined in descendants as:
Return the available table names
API Tags:
| Return: | with table names etc. |
Redefinition of:
- atkDb::table_names()
- Return the available table names
Redefined in descendants as:
Unlock table(s) in the database
API Tags:
Redefinition of:
- atkDb::unlock()
- Relieve all locks.
Redefined in descendants as:
String vendorDateFormat(
String
$format
)
|
|
Convert a php date() format specifier to a mysql specific format specifier.
Note that currently, only the common specifiers Y, m, d, H, h, i and s are supported.
Parameters:
|
String |
$format: |
Format specifier. The format is compatible with php's date() function (http://www.php.net/date) |
API Tags:
| Return: | Mysql specific format specifier. |
Redefinition of:
- atkDb::vendorDateFormat()
- Convert a php date() format specifier to a vendor specific format specifier.
string _getTableType(
string
$table
)
|
|
Returns the table type.
Parameters:
|
string |
$table: |
table name |
API Tags:
Redefined in descendants as:
void _setErrorVariables(
)
|
|
Store MySQL errors in internal variables
API Tags:
Redefined in descendants as:
Translates known database errors to developer-friendly messages
API Tags:
| Return: | Flag of the error |
Redefinition of:
- atkDb::_translateError()
- Translate database-vendor dependent error messages into an ATK generic error code.
Redefined in descendants as: