bool|resource delete(
string
$table, [
$index_data = false], string
$where
)
|
|
Remove one or more rows from a table.
Remove one or more rows from a table.
Parameters:
|
string |
$table: |
The table name from which to edit the data |
|
string |
$where: |
A MySQL WHERE-formatted query part or an array containing the indexing values |
|
|
$index_data: |
|
API Tags:
| Return: | Returns false in case of error or the resultset of the executed query |
Redefinition of:
- DBJet::delete()
- Delete a data row from the database
bool|resource fetch_array(
[int
$resmode = MYSQL_BOTH], [
$resultset = false]
)
|
|
Return a row from the last queried resultset
Return a row from the last queried resultset
Parameters:
|
int |
$resmode: |
The type of array that is to be fetched. It's a constant and can take the following values: MYSQL_ASSOC, MYSQL_NUM, and the default value of MYSQL_BOTH |
|
|
$resultset: |
|
API Tags:
| Return: | Returns the row or false in case of error or end of results |
Redefinition of:
- DBJet::fetch_array()
- Fetch a row from the resultset
bool|resource fetch_array_all(
[int
$resmode = MYSQL_BOTH], [
$resultset = false]
)
|
|
Return all the rows from the last queried resultset
Return all the rows from the last queried resultset
Parameters:
|
int |
$resmode: |
The type of array that is to be fetched. It's a constant and can take the following values: MYSQL_ASSOC, MYSQL_NUM, and the default value of MYSQL_BOTH |
|
|
$resultset: |
|
API Tags:
| Return: | Returns the row or false in case of error or end of results |
Redefinition of:
- DBJet::fetch_array_all()
- Fetch all the rows of the resultset
bool|resource fetch_value(
[resource
$result = false]
)
|
|
Return the first value of the first row of the requested query, using a specified resultset
Return the first value of the first row of the requested query, using a specified resultset
Parameters:
|
resource |
$result: |
(optional) Resultset obdained from a query() or query-like function |
API Tags:
| Return: | Returns the value or false in case of error |
Redefinition of:
- DBJet::fetch_value()
- Fetch a single value from the resultset
void free_query(
resource
$resultset
)
|
|
Release a specific query resultset
Release a specific query resultset
Parameters:
|
resource |
$resultset: |
Resultset obdained from query() function |
Release the last queried resultset
Release the last queried resultset
Visualize the queries being executed for debug purposes
Visualize the queries being executed for debug purposes
API Tags:
| Return: | Returns an HTML formatted result with the queries and their status |
string get_error_message(
[bool
$formatted = true]
)
|
|
Returns detailed information for the last error occured
Returns detailed information for the last error occured
Parameters:
|
bool |
$formatted: |
(optional) TRUE If you want the result to be a pre-formatted HTML response |
API Tags:
| Return: | An HTML-Formatted error description |
Redefinition of:
- DBJet::get_error_message()
- Get the last error message
List the database tables
List the database tables
API Tags:
| Return: | Returns false in case of error or the tables as array |
Redefinition of:
- DBJet::get_tables()
- Get the names of all the tables in the database
bool|array get_table_structure(
string
$table
)
|
|
Show the database structure
Show the database structure
Parameters:
|
string |
$table: |
The table name |
API Tags:
| Return: | Returns false in case of error or the table columns as associative array (Key = column name) |
Redefinition of:
- DBJet::get_table_structure()
- Get a table structure
void init(
$config, string
$vdb, string
$vhost, string
$vuser, string
$vpwd, bool
$presistent
)
|
|
Initializes MySQL Class
Initializes MySQL Class
Parameters:
|
string |
$vdb: |
Database name |
|
string |
$vhost: |
Database server host |
|
string |
$vuser: |
Login user name |
|
string |
$vpwd: |
Login user password |
|
bool |
$presistent: |
Make a presitent connection with the server |
|
|
$config: |
|
Redefinition of:
- DBJet::init()
- Initialize Database jet, using the configuration provided
bool|resource insert(
string
$table, array
$data
)
|
|
Insert a new row on specified table
Insert a new row on specified table
Parameters:
|
string |
$table: |
The table name to add the data |
|
array |
$data: |
An one-dimensional array that contains the field names (as keys) and the field values to add |
API Tags:
| Return: | Returns false in case of error or the resultset of the executed query |
Redefinition of:
- DBJet::insert()
- Insert a new data row on the database
void num_rows(
[
$resultset = false]
)
|
|
Parameters:
Redefinition of:
- DBJet::num_rows()
- Get the number of rows in the resultset
bool poll(
string
$query
)
|
|
Performs a query and returns true if the results are not empty
Performs a query and returns true if the results are not empty
Parameters:
|
string |
$query: |
The query to execute |
API Tags:
| Return: | Returns false in case of error or empty resultset, or true otherways |
bool|resource query(
string
$text
)
|
|
Performs a query
Performs a query
Parameters:
|
string |
$text: |
Query text to execute |
API Tags:
| Return: | Returns the query resultset or false in case of error |
Redefinition of:
- DBJet::query()
- Manually execute a complex SQL query
bool|string query_and_get_value(
string
$query
)
|
|
Performs a query and returns the first value of the first row or false in case of error
Performs a query and returns the first value of the first row or false in case of error
Parameters:
|
string |
$query: |
The query to execute |
API Tags:
| Return: | Returns false in case of error or the first row's first field value |
bool|resource replace(
string
$table, array
$data
)
|
|
Replace or insert a new row on specified table
Replace or insert a new row on specified table
Parameters:
|
string |
$table: |
The table name to add the data |
|
array |
$data: |
An one-dimensional array that contains the field names (as keys) and the field values to add |
API Tags:
| Return: | Returns false in case of error or the resultset of the executed query |
Redefinition of:
- DBJet::replace()
- Replace a data row into the database
Execute a SQL script
Execute a SQL script
Parameters:
|
string |
$file: |
The filename to load and run |
API Tags:
| Return: | Returns true if all the queries were successfull or false if one query failed |
bool|resource select(
string
$table, [string
$index_data = false], [string
$return_data = false], [
$order_by = false], [
$sort_order = false]
)
|
|
Select one or more rows from a table.
Select one or more rows from a table.
Parameters:
|
string |
$table: |
The table name from which to edit the data |
|
string |
$index_data: |
A MySQL WHERE-formatted query part or an array containing the indexing values |
|
string |
$return_data: |
A MySQL SELECT-formatted query part or an array containing the values to return |
|
|
$order_by: |
|
|
|
$sort_order: |
|
API Tags:
| Return: | Returns false in case of error or the resultset of the executed query |
Redefinition of:
- DBJet::select()
- Select a row from the database
void set_row(
int
$row, [
$resultset = false]
)
|
|
Moves the internal row pointer to a new position
Moves the internal row pointer to a new position
Parameters:
|
int |
$row: |
The row index to jump to |
|
|
$resultset: |
|
Redefinition of:
- DBJet::set_row()
- Set the current resultset pointer into a different row
string SQLTime(
int
$timestamp
)
|
|
Converts a UNIX timestamp into SQL timestamp
Converts a UNIX timestamp into SQL timestamp
Parameters:
|
int |
$timestamp: |
A UNIX timestamp value |
API Tags:
| Return: | Returns the value into MySQL timestamp format |
int UNIXTime(
string
$timestamp
)
|
|
Converts a UNIX timestamp into SQL timestamp
Converts a UNIX timestamp into SQL timestamp
Parameters:
|
string |
$timestamp: |
A MySQL timestamp value |
API Tags:
| Return: | Returns the value into UNIX timestamp format |
bool|resource update(
string
$table,
$index_data,
$insert_data, string
$where, array
$data
)
|
|
Update a row on a table.
Update a row on a table. The row to edit is defined by a where clause
Parameters:
|
string |
$table: |
The table name from which to edit the data |
|
string |
$where: |
A MySQL WHERE-formatted query part. This is used to identify the item(s) to edit (ex. "`index` = 2") |
|
array |
$data: |
An one-dimensional array that contains the field names (as keys) and the field values to edit |
|
|
$index_data: |
|
|
|
$insert_data: |
|
API Tags:
| Return: | Returns false in case of error or the resultset of the executed query |
Redefinition of:
- DBJet::update()
- Update a row on the database