Responsive web Framework

DOCUMENTATION

Db

Object that establishes connection to the database for the accomplishment of operationss

NOT AVAILABLE FOR TINY SCREENS

(minimum width: 480px)

Purpose

This object establishes the communication with the database in order to be able to interact with it. It is important to note that the configuration may be distant according to the user or control panel where it is located; being the administrative user one with all the privileges and one restricted for users or interface of the system.

The object variable $db is reserved for it.

Values

The system internally stores the following values

$str_DBHOST
Usually with the value of localhost. Stores the identity of the machine where the database is located.
$str_DBUSER
Database user There must be a user created for that purpose. Never use root user.
$str_DBPWD
Password.
$str_DBNAME
Database name.
$str_TABLEPREFIX
Prefix of the system tables. Its value is set during installation.

Description

The object $db, belongs to class DbConnection Is created only once per call, offering the following methods:

dbError()
In case of error with the database, it provides information about the type of error that occurred.
dbType()
Informative. Provides information about the type of connection used and associated version.
dbLogin()
Connects to the database
dbQuery(qry)
It receives as a parameter a query (string) and executes it. At some point it was considered to use a universal system of parameters, but given the complexity involved and that makes the difference between the different types of SQL calls was minimal, we chose to continue using this model.
dbClrQuotes(arr)
It receives as a parameter an array of values that it returns, replacing the values of 'and " with a secure code, in order to prevent code injection.
dbFetch(str)
Returns a line of results. In case the indicated parameter (str) is "hash" it returns the results in that format. By default, the results are delivered as array (array).
dbResult(str)
According to the indicated parameter (str), you can return the number of rows, free the contents of the result of the query (free), the entire block of results (all) or a value of -1 as error in case of Not be any of the above options.
dbLogout()
Disconnect from the database.
dbPrefix()
Returns the prefix used for tables.

Use

Requieres loading the library debug.

See it! icon execute code