Joomla! 1.5 API

Packages

Package: Joomla-Framework

License

Content on this site is copyright © 2005 - 2011 Open Source Matters Inc and can be used in accordance with the Joomla! Electronic Documentation License. Some parts of this website may be subject to other licenses.

 Class JDatabaseMySQL

Description

MySQL database driver

  • since: 1.0

Located in /joomla/database/database/mysql.php (line 25)

Class JObject   (Subpackage Base)

Abstract class JDatabase
   
   Class JDatabaseMySQL   (Subpackage Database)
Variable Summary
Variable string $name
Variable string $_nameQuote
Variable string $_nullDate
Method Summary
Static method static boolean test ()
Constructor JDatabaseMySQL __construct (array $options)
Destructor boolean __destruct ()
Method boolean connected ()
Method string explain ()
Method string getCollation ()
Abstract method string getEscaped (string $text, [boolean $extra = false])
Method int getNumRows ([ $cur = null])
Method array getTableCreate (array|string $tables)
Method array getTableFields (array|string $tables, [boolean $typeonly = true])
Method array getTableList ()
Method void getVersion ()
Method boolean hasUTF ()
Method void insertid ()
Method void insertObject (string $table, object An &$object, [string $keyName = NULL])
Method array loadAssoc ()
Method array loadAssocList ([string $key = ''])
Method object loadObject ()
Method array loadObjectList ([string $key = ''])
Method The loadResult ()
Method void loadResultArray ([ $numinarray = 0])
Method The loadRow ()
Method array loadRowList ([string $key = null])
Method mixed query ()
Method mixed queryBatch ([ $abort_on_error = true], [ $p_transaction_safe = false])
Method boolean select (string $database)
Method void setUTF ()
Method void updateObject ( $table,  &$object,  $keyName, [[type] $updateNulls = true])
Variables
string $name = 'mysql' (line 32)

The database driver name


Redefinition of:
JDatabase::$name
The database driver name
string $_nameQuote = '`' (line 46)

Quote for named objects


Redefinition of:
JDatabase::$_nameQuote
Quote for named objects
string $_nullDate = '0000-00-00 00:00:00' (line 39)

The null/zero date string


Redefinition of:
JDatabase::$_nullDate
The null/zero date string

Inherited Variables

Inherited from JDatabase

Variable JDatabase::$_cursor
Variable JDatabase::$_debug
Variable JDatabase::$_errorMsg
Variable JDatabase::$_errorNum
Variable JDatabase::$_hasQuoted
Variable JDatabase::$_limit
Variable JDatabase::$_log
Variable JDatabase::$_offset
Variable JDatabase::$_quoted
Variable JDatabase::$_resource
Variable JDatabase::$_sql
Variable JDatabase::$_table_prefix
Variable JDatabase::$_ticker
Variable JDatabase::$_utf

Inherited from JObject

Variable JObject::$_errors
Methods
Constructor __construct (line 56)

Database object constructor

JDatabaseMySQL __construct (array $options)
  • array $options: List of options used to configure the connection

Redefinition of:
JDatabase::__construct()
Database object constructor
Destructor __destruct (line 94)

Database object destructor

  • since: 1.5
boolean __destruct ()
connected (line 122)

Determines if the connection to the server is active.

  • since: 1.5
  • access: public
boolean connected ()

Redefinition of:
JDatabase::connected()
Determines if the connection to the server is active.
explain (line 301)

Diagnostic function

  • access: public
string explain ()

Redefinition of:
JDatabase::explain()
Diagnostic function
getAffectedRows (line 245)

Description

  • return: The number of affected rows in the previous operation
  • since: 1.0.5
  • access: public
int getAffectedRows ()

Redefinition of:
JDatabase::getAffectedRows()
Get the affected rows by the most recent query
getCollation (line 612)

Assumes database collation in use by sampling one text field in one table

  • return: Collation in use
  • access: public
string getCollation ()

Redefinition of:
JDatabase::getCollation()
Get the database collation
getEscaped (line 191)

Get a database escaped string

  • abstract:
  • access: public
string getEscaped (string $text, [boolean $extra = false])
  • string $text: The string to be escaped
  • boolean $extra: Optional parameter to provide extra escaping

Redefinition of:
JDatabase::getEscaped()
Get a database escaped string
getNumRows (line 342)

Description

  • return: The number of rows returned from the most recent query.
  • access: public
int getNumRows ([ $cur = null])
  • $cur

Redefinition of:
JDatabase::getNumRows()
Get the number of rows returned by the most recent query
getTableCreate (line 642)

Shows the CREATE TABLE statement that creates the given tables

  • return: A list the create SQL for the tables
  • access: public
array getTableCreate (array|string $tables)
  • array|string $tables: A table name or a list of table names

Redefinition of:
JDatabase::getTableCreate()
Shows the CREATE TABLE statement that creates the given tables
getTableFields (line 666)

Retrieves information about the given tables

  • return: An array of fields by table
  • access: public
array getTableFields (array|string $tables, [boolean $typeonly = true])
  • array|string $tables: A table name or a list of table names
  • boolean $typeonly: Only return field types, default true

Redefinition of:
JDatabase::getTableFields()
Retrieves information about the given tables
getTableList (line 629)

Description

  • return: A list of all the tables in the database
  • access: public
array getTableList ()

Redefinition of:
JDatabase::getTableList()
List tables in a database
getVersion (line 601)

Description

  • access: public
void getVersion ()

Redefinition of:
JDatabase::getVersion()
Get the version of the database connector
hasUTF (line 166)

Determines UTF support

  • return: True - UTF is supported
  • access: public
boolean hasUTF ()

Redefinition of:
JDatabase::hasUTF()
Determines UTF support
insertid (line 591)

Description

  • access: public
void insertid ()

Redefinition of:
JDatabase::insertid()
Get the ID generated from the previous INSERT operation
insertObject (line 526)

Inserts a row into a table based on an objects properties

  • access: public
void insertObject (string $table, object An &$object, [string $keyName = NULL])
  • string $table: The name of the table
  • object An &$object: object whose properties match table fields
  • string $keyName: The name of the primary key. If provided the object property is updated.

Redefinition of:
JDatabase::insertObject()
Inserts a row into a table based on an objects properties
loadAssoc (line 390)

Fetch a result row as an associative array

  • access: public
array loadAssoc ()

Redefinition of:
JDatabase::loadAssoc()
Fetch a result row as an associative array
loadAssocList (line 410)

Load a assoc list of database rows

  • return: If key is empty as sequential list of returned records.
  • access: public
array loadAssocList ([string $key = ''])
  • string $key: The field name of a primary key

Redefinition of:
JDatabase::loadAssocList()
Load a associactive list of database rows
loadObject (line 433)

This global function loads the first row of a query into an object

  • access: public
object loadObject ()

Redefinition of:
JDatabase::loadObject()
This global function loads the first row of a query into an object
loadObjectList (line 456)

Load a list of database objects

If key is not empty then the returned array is indexed by the value the database key. Returns null if the query fails.

  • return: If key is empty as sequential list of returned records.
  • access: public
array loadObjectList ([string $key = ''])
  • string $key: The field name of a primary key

Redefinition of:
JDatabase::loadObjectList()
Load a list of database objects
loadResult (line 353)

This method loads the first field of the first row returned by the query.

  • return: value returned in the query or null if the query failed.
  • access: public
The loadResult ()

Redefinition of:
JDatabase::loadResult()
This method loads the first field of the first row returned by the query.
loadResultArray (line 371)

Load an array of single field results into an array

  • access: public
void loadResultArray ( $numinarray)
  • $numinarray

Redefinition of:
JDatabase::loadResultArray()
Load an array of single field results into an array
loadRow (line 479)

Description

  • return: first row of the query.
  • access: public
The loadRow ()

Redefinition of:
JDatabase::loadRow()
Load the first row returned by the query
loadRowList (line 501)

Load a list of database rows (numeric column indexing)

  • return: If key is empty as sequential list of returned records. If key is not empty then the returned array is indexed by the value the database key. Returns null if the query fails.
  • access: public
array loadRowList ([string $key = null])
  • string $key: The field name of a primary key

Redefinition of:
JDatabase::loadRowList()
Load a list of database rows (numeric column indexing)
query (line 206)

Execute the query

  • return: A database resource if successful, FALSE if not.
  • access: public
mixed query ()

Redefinition of:
JDatabase::query()
Execute the query
queryBatch (line 256)

Execute a batch query

  • return: A database resource if successful, FALSE if not.
  • access: public
mixed queryBatch ([ $abort_on_error = true], [ $p_transaction_safe = false])
  • $abort_on_error
  • $p_transaction_safe

Redefinition of:
JDatabase::queryBatch()
Execute a batch query
select (line 138)

Select a database for use

  • return: True if the database has been successfully selected
  • since: 1.5
  • access: public
boolean select (string $database)
  • string $database
setUTF (line 177)

Custom settings for UTF support

  • access: public
void setUTF ()

Redefinition of:
JDatabase::setUTF()
Custom settings for UTF support
test (line 110)

Test to see if the MySQL connector is available

  • return: True on success, false otherwise.
  • access: public
boolean test ()

Redefinition of:
JDatabase::test()
Test to see if the MySQLi connector is available
updateObject (line 557)

Description

  • access: public
void updateObject ( $table,  &$object,  $keyName, [[type] $updateNulls = true])
  • [type] $updateNulls
  • $table
  • &$object
  • $keyName

Redefinition of:
JDatabase::updateObject()
Update an object in the database

Inherited Methods

Inherited From JDatabase

 JDatabase::__construct()
 JDatabase::addQuoted()
 JDatabase::BeginTrans()
 JDatabase::CommitTrans()
 JDatabase::connected()
 JDatabase::debug()
 JDatabase::ErrorMsg()
 JDatabase::ErrorNo()
 JDatabase::Execute()
 JDatabase::explain()
 JDatabase::GenID()
 JDatabase::getAffectedRows()
 JDatabase::GetCol()
 JDatabase::getCollation()
 JDatabase::getConnectors()
 JDatabase::getErrorMsg()
 JDatabase::getErrorNum()
 JDatabase::getEscaped()
 JDatabase::getInstance()
 JDatabase::getLog()
 JDatabase::getNullDate()
 JDatabase::getNumRows()
 JDatabase::GetOne()
 JDatabase::getPrefix()
 JDatabase::getQuery()
 JDatabase::GetRow()
 JDatabase::getTableCreate()
 JDatabase::getTableFields()
 JDatabase::getTableList()
 JDatabase::getTicker()
 JDatabase::getUTFSupport()
 JDatabase::getVersion()
 JDatabase::hasUTF()
 JDatabase::insertid()
 JDatabase::insertObject()
 JDatabase::isQuoted()
 JDatabase::loadAssoc()
 JDatabase::loadAssocList()
 JDatabase::loadObject()
 JDatabase::loadObjectList()
 JDatabase::loadResult()
 JDatabase::loadResultArray()
 JDatabase::loadRow()
 JDatabase::loadRowList()
 JDatabase::nameQuote()
 JDatabase::PageExecute()
 JDatabase::query()
 JDatabase::queryBatch()
 JDatabase::Quote()
 JDatabase::replacePrefix()
 JDatabase::RollbackTrans()
 JDatabase::SelectLimit()
 JDatabase::setQuery()
 JDatabase::setUTF()
 JDatabase::splitSql()
 JDatabase::stderr()
 JDatabase::test()
 JDatabase::updateObject()

Inherited From JObject

 JObject::JObject()
 JObject::__construct()
 JObject::get()
 JObject::getError()
 JObject::getErrors()
 JObject::getProperties()
 JObject::getPublicProperties()
 JObject::set()
 JObject::setError()
 JObject::setProperties()
 JObject::toString()
Support Joomla!