Database object constructor
JDatabase
__construct
([string $host = 'localhost'], string $user, string $pass, [string $db = ''], [string $table_prefix = ''])
-
string
$host: Database host
-
string
$user: Database user name
-
string
$pass: Database user password
-
string
$db: Database name
-
string
$table_prefix: Common prefix for all tables
Redefinition of:
- JObject::__construct()
- Class constructor, overridden in descendant classes.
Redefined in descendants as:
Adds a field or array of field names to the list that are to be quoted
void
addQuoted
(mixed $quoted)
-
mixed
$quoted: Field name or array of names
ADODB compatability function
void
BeginTrans
()
ADODB compatability function
void
CommitTrans
()
Sets the debug level on or off
void
debug
(int $level)
-
int
$level: 0 = off, 1 = on
ADODB compatability function
void
ErrorMsg
()
ADODB compatability function
void
ErrorNo
()
ADODB compatability function
object
Execute
(string $query)
Diagnostic function
void
explain
()
Redefined in descendants as:
ADODB compatability function
void
GenID
([mixed $foo1 = null], [mixed $foo2 = null])
int
getAffectedRows
()
Redefined in descendants as:
ADODB compatability function
void
GetCol
(string $query)
string
getCollation
()
Redefined in descendants as:
Get a database escaped string
string
getEscaped
(mixed $text)
Redefined in descendants as:
Returns a reference to the global Database object, only creating it if it doesn't already exist.
database
&getInstance
([
string $driver =
'MySQL'], [
string $host =
'localhost'],
string $user,
string $pass, [
string $db =
''], [
string $table_prefix =
''])
-
string
$driver: Database driver
-
string
$host: Database host
-
string
$user: Database user name
-
string
$pass: Database user password
-
string
$db: Database name
-
string
$table_prefix: Common prefix for all tables
int
getNumRows
([object Database $cur = null])
-
object Database
$cur: resource
Redefined in descendants as:
ADODB compatability function
mixed
GetOne
(string $query)
Returns an array of public properties
array
getPublicProperties
()
ADODB compatability function
array
GetRow
(string $query)
array
getTableCreate
(array $tables)
-
array
$tables: A list of table names
Redefined in descendants as:
array
getTableFields
(array $tables)
-
array
$tables: A list of table names
Redefined in descendants as:
array
getTableList
()
Redefined in descendants as:
void
getVersion
()
Redefined in descendants as:
Determines UTF support
boolean
hasUTF
()
Redefined in descendants as:
mixed
insertid
()
Redefined in descendants as:
void
insertObject
(string $table, object &$object, [string $keyName = NULL], [boolean $verbose = false])
-
string
$table: The table name
-
object
&$object
-
string
$keyName
-
boolean
$verbose
Redefined in descendants as:
Checks if field name needs to be quoted
bool
isQuoted
(string $fieldName)
-
string
$fieldName: The field name
Load a assoc list of database rows
array
loadAssocList
([string $key = ''])
-
string
$key: The field name of a primary key
Redefined in descendants as:
This global function loads the first row of a query into an object If an object is passed to this function, the returned row is bound to the existing elements of object. If object has a value of null, then all of the returned query fields returned in the object.
void
loadObject
(object The &$object)
-
object The
&$object: address of variable
Redefined in descendants as:
Load a list of database objects
array
loadObjectList
([string $key = ''])
-
string
$key: The field name of a primary key
Redefined in descendants as:
This method loads the first field of the first row returned by the query.
The
loadResult
()
Redefined in descendants as:
Load an array of single field results into an array
void
loadResultArray
(mixed $numinarray)
Redefined in descendants as:
The
loadRow
()
Redefined in descendants as:
Load a list of database rows (numeric column indexing)
array
loadRowList
([string $key = ''])
-
string
$key: The field name of a primary key
Redefined in descendants as:
Quote an identifier name (field, table, etc)
string
NameQuote
(string $s)
ADODB compatability function
void
PageExecute
(mixed $sql, mixed $nrows, mixed $page, [mixed $inputarr = false], mixed $secs2cache)
Execute the query
mixed
query
()
Redefined in descendants as:
Execute a batch query
mixed
query_batch
([mixed $abort_on_error = true], [mixed $p_transaction_safe = false])
Redefined in descendants as:
Get a quoted database escaped string
string
Quote
(mixed $text)
This function replaces a string identifier $prefix with the string held is the _table_prefix class variable.
void
replacePrefix
(string $sql, [string $prefix = '#__'])
-
string
$sql: The SQL query
-
string
$prefix: The common table prefix
ADODB compatability function
void
RollbackTrans
()
ADODB compatability function
void
SelectLimit
(mixed $query, mixed $count, mixed $offset)
Sets the SQL query string for later execution.
This function replaces a string identifier $prefix with the string held is the _table_prefix class variable.
void
setQuery
(string $sql, string $offset, string $limit, [string $prefix = '#__'])
-
string
$sql: The SQL query
-
string
$offset: The offset to start selection
-
string
$limit: The number of results to return
-
string
$prefix: The common table prefix
Custom settings for UTF support
void
setUTF
()
Redefined in descendants as:
string
stderr
([boolean $showSQL = false])
-
boolean
$showSQL: If TRUE, displays the last SQL statement sent to the database
void
updateObject
(string $table, object &$object, string $keyName, [boolean $updateNulls = true])
-
string
$table
-
object
&$object
-
string
$keyName
-
boolean
$updateNulls
Redefined in descendants as:
Inherited Methods
Inherited From JObject
JObject::__construct()
JObject::JObject()
JObject::get()
JObject::set()
JObject::toString()
JObject::__destruct()