Extends PDO class
Sets database connections to automatically use utf-8 and provides some useful debugging behaviour, lazy shortcuts etc
package | dstruct_common |
---|
__construct(string $dbtype, string $host, string $uname, string $pwd, string $schema, integer $port, string $charset) : object
Any errors setting up the connection etc are echoed to the browser!
todo | Check $dbtype has an available driver? |
---|
string
Database type to access e.g. MySQL, SQLITE etc
string
Hostname or IP address
string
Database user name
string
Database password
string
Database schema to connect to
integer
Port to attempt connection on
string
Characterset to use
object
PDO database objectgetNewStatementCount() : integer
Mainly useful for optimisation.
integer
getQueryCount() : integer
Mainly useful for optimisation.
integer
prepare(integer $statement, array $driver_options)
See PDO manual for usage.
integer
SQL statement to prepare
array
See PDO manual
query(string $query) : object
Development tool.
Should not be used in a production environment in general as using prepared statements is safer
and potentially faster (if statement is re-used). Remember to always escape any data which can
not be trusted with PDO::quote().
Increments db::$querycount
see | \DB::queryNoOverload |
---|
string
SQL string
object
queryNoOverload(string $query) : object
PDO::query() is overloaded when using the query() function of this class, so this provides a way of accessing it without the overloaded code
string
SQL Statement
object
$newstatements : \unknown
$querycount : integer
see | \getQueryCount() |
---|