Public Member Functions | |
| __construct () | |
| create_database () | |
| close () | |
| query ($sql, $params=[]) | |
Protected Attributes | |
| $conn = null | |
| $last_results = null | |
Last Query's Results Retrieving Functions | |
| res_field ($field) | |
| res_nth_row ($num) | |
| get_last_results () | |
| field_exists ($fieldname) | |
| __construct | ( | ) |
Create a new DbConn instance. Create database and tables if needed.
We don't ask for parameters because it cames from globals parameters.
Yes, I know, is not the best way, but life's short!
| close | ( | ) |
Close connection.
| create_database | ( | ) |
Create all tables if they don't exists. Also select the database.
|
protected |
This field name exists in the last results?
| get_last_results | ( | ) |
Retrieve the mysqli_result instance of the last query.
| query | ( | $sql, | |
$params = [] |
|||
| ) |
Send a query to the DB.
| $sql | a String. |
| res_field | ( | $field | ) |
Retrieve all the field values.
| res_nth_row | ( | $num | ) |
Retrieve the n-th row from the last results.
| num | A positive integer from cero (inclusive) and the amount of rows minus one inclusive. |
|
protected |
The DB connection. Needed by the mysql_connect() PHP function.
|
protected |
Last query's results.
1.8.8