StockManiac 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) |
Number of records affected by the last query.
Useful to check in advance whether the query did actually return something.
Human readable error string returned by the DBMS (mostly). If set this should always indicate some sort of lower level SQL problem.
Execution time of last query, in microseconds.
Database Connection
Query Result Object
Inherited from gui
gui::$themes
gui::$_smarty
Inherited from session
session::$err
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.
Escape referenced string to make it 'sql safe'. Useful as callback.
Return the entire result set in one array or false.
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.
Return the entire result set as array of $class objects
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.
Return single row from SQL result. Useful in while constructs.
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 :-)
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