Executes sql statemnt(s) in transaction
Parameters:
API Tags:
boolean __construct(
string
$dsn
)
|
|
Constructor
Attempts to connect to database specified with dsn
Parameters:
API Tags:
| Return: | returns true on success, flase otherwise |
Redefined in descendants as:
Destructor
Here is the place to disconnect nicely from the database
API Tags:
Redefined in descendants as:
Finishing transaction
API Tags:
Redefined in descendants as:
Tries to connect to DB
API Tags:
Redefined in descendants as:
Disconnects from the DB
API Tags:
Redefined in descendants as:
void execute(
string
$sql, [
$ignore_sql_injection_warning = false]
)
|
|
Executes SQL statemnt
Parameters:
|
string |
$sql: |
|
|
|
$ignore_sql_injection_warning: |
|
API Tags:
Redefined in descendants as:
Manually marking transaction as failed
API Tags:
Redefined in descendants as:
void generate_id(
$sequence_name, [unknown_type
$start = 1], string
$table_id_is_for
)
|
|
Generates next id from sequence
For RDBMS that does not support sequences this have to be emulated by DB abstraction layer
Parameters:
|
string |
$table_id_is_for: |
name of the sequence |
|
unknown_type |
$start: |
if sequence is not existing $start will be used as initial value when sequence is automatically created |
|
|
$sequence_name: |
|
API Tags:
Redefined in descendants as:
unknown get_autocommit(
)
|
|
Gets autocommit mode
API Tags:
Returns internal db connection object
This function should be used only if you REALLY need to use DBAL (ADODB, PDO, etc...) specific calls.
API Tags:
Returns error message if any
API Tags:
Redefined in descendants as:
Gets $this->connected
API Tags:
boolean is_like_sql_injection(
string
$sql
)
|
|
Checks if $sql looks like SQL injection attempt
This function will check if there are comments in the $sql and if found will return true. Don't overtrust this to keep you safe - allways check and escape data before sending it as SQL statement to the RDBMS
Parameters:
API Tags:
| Return: | Returns true if $sql is suspicious |
| Access: | protected |
void query(
string
$sql
)
|
|
Alias of execute()
Parameters:
API Tags:
Redefined in descendants as:
string remove_quoted(
string
$sql_str
)
|
|
Removes quoted content from $sql_str
Parameters:
API Tags:
| Internal: | |
| Access: | private |
void select_limit(
string
$sql, integer
$num_rows, integer
$offset
)
|
|
Selects limited ammount of rows
Useful for paginating the results.
Parameters:
|
string |
$sql: |
SQL statement |
|
integer |
$num_rows: |
number of rows to select |
|
integer |
$offset: |
offset to start |
API Tags:
Redefined in descendants as:
void set_autocommit(
unknown_type
$auto
)
|
|
Sets autocommit mode
Parameters:
API Tags:
void set_connected(
boolean
$connected
)
|
|
Sets $this->connected
Parameters:
API Tags:
Starting transaction
API Tags:
Redefined in descendants as:
string _remove_quoted_with(
string
$sql_str, string
$q
)
|
|
Removes quoted with $q from $sql_str
Parameters:
|
string |
$sql_str: |
|
|
string |
$q: |
One character ' or " |
API Tags: