XOOPS  2.6.0
XoopsDatabase Class Reference
Inheritance diagram for XoopsDatabase:
Inheritance graph

Public Member Functions

 close ()
 
 connect ($selectdb=true)
 
 errno ()
 
 error ()
 
 escape ($string)
 
 fetchArray ($result)
 
 fetchBoth ($result)
 
 fetchObject ($result)
 
 fetchRow ($result)
 
 freeRecordSet ($result)
 
 genId ($sequence)
 
 getAffectedRows ()
 
 getFieldName ($result, $offset)
 
 getFieldsNum ($result)
 
 getFieldType ($result, $offset)
 
 getInsertId ()
 
 getRowsNum ($result)
 
 prefix ($tablename= '')
 
 query ($sql, $limit=0, $start=0)
 
 queryF ($sql, $limit=0, $start=0)
 
 queryFromFile ($file)
 
 quote ($string)
 
 quoteString ($str)
 
 setPrefix ($value)
 

Public Attributes

 $allowWebChanges = false
 
 $conn
 
 $prefix = ''
 

Detailed Description

Definition at line 28 of file database.php.

Member Function Documentation

XoopsDatabase::close ( )
abstract

Close MySQL connection

Returns
void
Deprecated:
since version 2.6.0 - alpha 3. Switch to doctrine connector.
XoopsDatabase::connect (   $selectdb = true)
abstract

connect to the database

Parameters
bool$selectdbselect the database now?
Returns
bool successful?
Deprecated:
since version 2.6.0 - alpha 3. Switch to doctrine connector.
XoopsDatabase::errno ( )
abstract

Returns the numerical value of the error message from previous MySQL operation

Returns
int Returns the error number from the last MySQL function , or 0 (zero) if no error occurred.
Deprecated:
since version 2.6.0 - alpha 3. Switch to doctrine connector.
XoopsDatabase::error ( )
abstract

Returns the text of the error message from previous MySQL operation

Returns
bool Returns the error text from the last MySQL function, or '' (the empty string) if no error occurred.
Deprecated:
since version 2.6.0 - alpha 3. Switch to doctrine connector.
XoopsDatabase::escape (   $string)
abstract

Returns escaped string text without quotes around it

Parameters
string$stringunescaped string text
Returns
string escaped text string escaped to be safely used in database calls
Deprecated:
since version 2.6.0 - alpha 3. Switch to doctrine connector.
XoopsDatabase::fetchArray (   $result)
abstract

Fetch a result row as an associative array

Parameters
resource$resultresource to get result from
Returns
array
Deprecated:
since version 2.6.0 - alpha 3. Switch to doctrine connector.
XoopsDatabase::fetchBoth (   $result)
abstract

Fetch a result row as an associative array

Parameters
resource$resultresource to get result from
Returns
array
Deprecated:
since version 2.6.0 - alpha 3. Switch to doctrine connector.
XoopsDatabase::fetchObject (   $result)
abstract

Fetch a result row as an object

Parameters
resource$resultresource to get result from
Returns
object|stdClass
Deprecated:
since version 2.6.0 - alpha 3. Switch to doctrine connector.
XoopsDatabase::fetchRow (   $result)
abstract

Get a result row as an enumerated array

Parameters
resource$resultresource to get result from
Returns
array
Deprecated:
since version 2.6.0 - alpha 3. Switch to doctrine connector.
XoopsDatabase::freeRecordSet (   $result)
abstract

Free all memory associated with the result identifier result.

Parameters
resource$resultquery result
Returns
bool TRUE on success or FALSE on failure.
Deprecated:
since version 2.6.0 - alpha 3. Switch to doctrine connector.
XoopsDatabase::genId (   $sequence)
abstract

generate an ID for a new row

This is for compatibility only. Will always return 0, because MySQL supports autoincrement for primary keys.

Parameters
string$sequencename of the sequence from which to get the next ID
Returns
int always 0, because mysql has support for autoincrement
Deprecated:
since version 2.6.0 - alpha 3. Switch to doctrine connector.
XoopsDatabase::getAffectedRows ( )
abstract

Get number of affected rows

Returns
int
Deprecated:
since version 2.6.0 - alpha 3. Switch to doctrine connector.
XoopsDatabase::getFieldName (   $result,
  $offset 
)
abstract

Get field name

Parameters
resource$resultquery result
int$offsetnumerical field index
Returns
string
Deprecated:
since version 2.6.0 - alpha 3. Switch to doctrine connector.
XoopsDatabase::getFieldsNum (   $result)
abstract

Get number of fields in result

Parameters
resource$resultquery result
Returns
int
Deprecated:
since version 2.6.0 - alpha 3. Switch to doctrine connector.
XoopsDatabase::getFieldType (   $result,
  $offset 
)
abstract

Get field type

Parameters
resource$resultquery result
int$offsetnumerical field index
Returns
string
Deprecated:
since version 2.6.0 - alpha 3. Switch to doctrine connector.
XoopsDatabase::getInsertId ( )
abstract

Get the ID generated from the previous INSERT operation

Returns
int
Deprecated:
since version 2.6.0 - alpha 3. Switch to doctrine connector.
XoopsDatabase::getRowsNum (   $result)
abstract

Get number of rows in result

Parameters
resource$resultthe resource containing the number of rows
Returns
int the number of rows to return
Deprecated:
since version 2.6.0 - alpha 3. Switch to doctrine connector.
XoopsDatabase::prefix (   $tablename = '')

public function prefix($tablename = '')

attach the prefix.'_' to a given tablename if tablename is empty, only prefix will be returned

Parameters
string$tablenametablename
Returns
string prefixed tablename, just prefix if tablename is empty
Deprecated:
since version 2.6.0 - alpha 3. Switch to doctrine connector.

Definition at line 76 of file database.php.

References $prefix.

Referenced by XoopsMySQLDatabase\queryFromFile(), and setPrefix().

Here is the caller graph for this function:

XoopsDatabase::query (   $sql,
  $limit = 0,
  $start = 0 
)
abstract

perform a query

This method is empty and does nothing! It should therefore only be used if nothing is exactly what you want done! ;-)

Parameters
string$sqla valid MySQL query
int$limitnumber of records to return
int$startoffset of first record to return
Returns
resource returns nothing
Deprecated:
since version 2.6.0 - alpha 3. Switch to doctrine connector.
XoopsDatabase::queryF (   $sql,
  $limit = 0,
  $start = 0 
)
abstract

perform a query on the database

Parameters
string$sqla valid MySQL query
int$limitnumber of records to return
int$startoffset of first record to return
Returns
bool|resource query result or FALSE if successful or TRUE if successful and no result
Deprecated:
since version 2.6.0 - alpha 3. Switch to doctrine connector.
XoopsDatabase::queryFromFile (   $file)
abstract

perform queries from SQL dump file in a batch

Parameters
string$filefile path to an SQL dump file
Returns
bool FALSE if failed reading SQL file or TRUE if the file has been read and queries executed
Deprecated:
since version 2.6.0 - alpha 3
XoopsDatabase::quote (   $string)
abstract

Quotes a string for use in a query.

Parameters
string$stringstring to quote
Returns
string
Deprecated:
since version 2.6.0 - alpha 3. Switch to doctrine connector.
XoopsDatabase::quoteString (   $str)
abstract

Returns escaped string text with single quotes around it to be safely stored in database

Parameters
string$strunescaped string text
Returns
string escaped string text with single quotes around
Deprecated:
since version 2.6.0 - alpha 3. Switch to doctrine connector.
XoopsDatabase::setPrefix (   $value)

set the prefix for tables in the database

Parameters
string$valuetable prefix
Returns
this does not return a value
Deprecated:
since version 2.6.0 - alpha 3. Switch to doctrine connector.

Definition at line 60 of file database.php.

References prefix().

Here is the call graph for this function:

Member Data Documentation

XoopsDatabase::$allowWebChanges = false

Definition at line 49 of file database.php.

XoopsDatabase::$conn

Definition at line 35 of file database.php.

XoopsDatabase::$prefix = ''

Definition at line 42 of file database.php.

Referenced by prefix().


The documentation for this class was generated from the following file: