dbcStockManiac Database Connection (DBC)
Establish connection to the DBMS and provide lower level public functionality for to executing SQL queries in a abstracted manner. As of now it utilizes the MySQLi extension build into PHP.
Located in /lib/dbc.class.php (line 47)
session | --gui | --dbc
| Class | Description |
|---|---|
dbi
|
StockManiac Database Interface (DBI) |
void
__construct
([string $user = MYSQL_USER], [string $pass = MYSQL_PASS], [string $schema = MYSQL_DB], [boolt $no_parent_constructor = false])
int
$sql_affected_rows
(line 82)
Number of records affected by the last query.
Useful to check in advance whether the query did actually return something.
string
$sql_error
(line 110)
Human readable error string returned by the DBMS (mostly). If set this should always indicate some sort of lower level SQL problem.
int
$sql_execution_time
(line 95)
Execution time of last query, in microseconds.
mysqli
$_db
(line 57)
Database Connection
mysqli_result
$_result
(line 67)
Query Result Object
Inherited from gui
gui::$themes
gui::$_smarty
Inherited from session
session::$err
Constructor __construct (line 132)
sql (line 204)
Execute SQL Statement. Returns true on success, false on failure.
The resulting data (if any) can be fetched through one of the public sql_get_*() methods.
sql_escape_string (line 170)
Escape referenced string to make it 'sql safe'. Useful as callback.
sql_get_array_result (line 535)
Return the entire result set in one array or false.
sql_get_indexedlist_result (line 586)
Return a indexed list from result set or false on failure.
result is of the form
By default the first column is used as key and the second column as value (you specify other columns with $key and/or $val). All other columns that may have been returned by the query are ignored. This method is useful to generate input for HTML <<option>> elements.
sql_get_objectarray_result (line 556)
Return the entire result set as array of $class objects
sql_get_object_result (line 520)
Return single row from SQL result as object of $class.
$class should usually be a vo_* or dao_* class and should match with the fields returned by the sql query.
sql_get_result (line 505)
Return single row from SQL result. Useful in while constructs.
sql_max_packet_size (line 610)
Determine how much we can send at once to the DBMS. Return number of bytes.
NOTE: the result is safe enough for caching during a session, for the sake of performance :-)
sql_script (line 263)
Execute SQL Statements from $file.
Returns the number of SQL statements processd on success or dies if any* statement in $file fails. Set * $die_on_failure=false if you want to survive failures.
The SQL parser code in this method was taken from the SQL importer plugin (libraries/import/sql.php) from the phpMyAdmin Project and has been slightly modified to work in this context. Kudos to all people who wrote this code!
Inherited From gui
gui::__construct()
gui::append()
gui::assign()
gui::debug()
gui::display()
gui::get_microtime()
gui::get_template_vars()
gui::get_themes()
gui::register_object()
gui::set_default_theme()
Inherited From session
session::__construct()
session::sess_destroy()
session::sess_exists()
session::sess_get_var()
session::sess_store_var()
session::sess_unset_var()
Documentation generated on Sun, 22 Aug 2010 11:20:17 +0200 by phpDocumentor 1.4.3