Documentation

database

This object is the connector to the database called db.

Internal Values

Internally, it uses two variables: db_this and db_result to store the connection to the database and the result obtained, respectively.

Functions/Methods

Function and procedure names are preceded by the prefix db, which is the same name as the returned connector object.

dbError

Returns the error code and type if one occurs.

dbType

Returns the type of database used (is it necessary?)

dbLogin

Connects to the database, sets the use of UTF8 for data storage, and creates the corresponding connector. It uses four internal values, which are set during system installation.

DBHOST
Database server. Usually localhost.
DBUSER
Database user. All permissions for administrator, restricted permissions for user.
DBPWD
Password
DBNAME
Database name

Although the structure of the function is the same, it is important to remember that the system handles two types of database users. One has full permissions and is used by system administrators. The remaining accounts use restricted permissions.

dbPrefix

Returns the table prefix; it is also configured when the system is installed.

DBPREFIX
Prefix of tables belonging to siteup

dbQuery

Executes a SQL operation

dbClearQuotes

Receives an array of data, prefixed with a backslash (\) before quotation marks and double quotes. While there are instructions that replace HTML entities with their equivalent, this is restricted to those two cases only.
Returns the same array with the corresponding modifications.

dbFilter2Sql

Receives a JSON containing the filters to be applied to a query, returning the corresponding SQL.

dbResult

Obtains the result of the query execution. By default, all results are stored in the corresponding variable, although using rows as a parameter indicates the number of results; If free is used, it frees the results obtained.

dbFetch

Returns each of the records, which is why this statement must be in a loop. By default, the result is returned as an array, although if the word hash is specified as a parameter, it returns the record as an array indexed by the word, the word being the column name.

dbLogout

Closes the connection to the database

Search