XOOPS  2.6.0
XoopsMySQLDatabase Class Reference
Inheritance diagram for XoopsMySQLDatabase:
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)
 
 query ($sql, $limit=0, $start=0)
 
 queryF ($sql, $limit=0, $start=0)
 
 queryFromFile ($file)
 
 quote ($string)
 
 quoteString ($str)
 
- Public Member Functions inherited from XoopsDatabase
 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

 $conn
 
- Public Attributes inherited from XoopsDatabase
 $allowWebChanges = false
 
 $conn
 
 $prefix = ''
 

Protected Member Functions

 deprecated ()
 

Private Attributes

 $connect = false
 
 $lastResult = null
 
 $selectdb
 

Detailed Description

Definition at line 30 of file mysqldatabase.php.

Member Function Documentation

XoopsMySQLDatabase::close ( )

Close MySQL connection

Returns
void
Deprecated:
since version 2.6.0 - alpha 3. Switch to doctrine connector.

Definition at line 229 of file mysqldatabase.php.

References deprecated().

Here is the call graph for this function:

XoopsMySQLDatabase::connect (   $selectdb = true)

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.

Definition at line 87 of file mysqldatabase.php.

References $_SERVER, $connect, and $selectdb.

XoopsMySQLDatabase::deprecated ( )
protected

Issue a deprecated warning once per session

Returns
void

Definition at line 64 of file mysqldatabase.php.

References Xoops\getInstance().

Referenced by close(), errno(), error(), escape(), fetchArray(), fetchBoth(), fetchObject(), fetchRow(), freeRecordSet(), genId(), getAffectedRows(), getFieldName(), getFieldsNum(), getFieldType(), getInsertId(), XoopsMySQLDatabaseSafe\query(), XoopsMySQLDatabaseProxy\query(), query(), queryF(), queryFromFile(), quote(), and quoteString().

Here is the call graph for this function:

Here is the caller graph for this function:

XoopsMySQLDatabase::errno ( )

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.

Definition at line 272 of file mysqldatabase.php.

References deprecated().

Here is the call graph for this function:

XoopsMySQLDatabase::error ( )

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.

Definition at line 257 of file mysqldatabase.php.

References deprecated().

Here is the call graph for this function:

XoopsMySQLDatabase::escape (   $string)

Escapes a string for use in a query. Does not add quotes.

Parameters
string$stringstring to escape
Returns
string
Deprecated:
since version 2.6.0 - alpha 3. Switch to doctrine connector.

Definition at line 318 of file mysqldatabase.php.

References deprecated(), and quote().

Here is the call graph for this function:

XoopsMySQLDatabase::fetchArray (   $result)

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.

Definition at line 138 of file mysqldatabase.php.

References $result, and deprecated().

Here is the call graph for this function:

XoopsMySQLDatabase::fetchBoth (   $result)

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.

Definition at line 156 of file mysqldatabase.php.

References $result, and deprecated().

Here is the call graph for this function:

XoopsMySQLDatabase::fetchObject (   $result)

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.

Definition at line 174 of file mysqldatabase.php.

References $result, and deprecated().

Here is the call graph for this function:

XoopsMySQLDatabase::fetchRow (   $result)

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.

Definition at line 121 of file mysqldatabase.php.

References $result, and deprecated().

Here is the call graph for this function:

XoopsMySQLDatabase::freeRecordSet (   $result)

will 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.

Definition at line 243 of file mysqldatabase.php.

References $result, and deprecated().

Here is the call graph for this function:

XoopsMySQLDatabase::genId (   $sequence)

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.

Definition at line 107 of file mysqldatabase.php.

References deprecated().

Here is the call graph for this function:

object keep track of last result since we need it for XoopsMySQLDatabase::getAffectedRows ( )

Get number of affected rows

Returns
int
Deprecated:
since version 2.6.0 - alpha 3. Switch to doctrine connector.

Definition at line 217 of file mysqldatabase.php.

References deprecated().

Here is the call graph for this function:

XoopsMySQLDatabase::getFieldName (   $result,
  $offset 
)

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.

Definition at line 424 of file mysqldatabase.php.

References $result, $temp, and deprecated().

Here is the call graph for this function:

XoopsMySQLDatabase::getFieldsNum (   $result)

Get number of fields in result

Parameters
resource$resultquery result
Returns
int
Deprecated:
since version 2.6.0 - alpha 3. Switch to doctrine connector.

Definition at line 483 of file mysqldatabase.php.

References $result, and deprecated().

Here is the call graph for this function:

XoopsMySQLDatabase::getFieldType (   $result,
  $offset 
)

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.

Definition at line 446 of file mysqldatabase.php.

References $result, $temp, and deprecated().

Here is the call graph for this function:

XoopsMySQLDatabase::getInsertId ( )

Get the ID generated from the previous INSERT operation

Returns
int
Deprecated:
since version 2.6.0 - alpha 3. Switch to doctrine connector.

Definition at line 190 of file mysqldatabase.php.

References deprecated().

Here is the call graph for this function:

XoopsMySQLDatabase::getRowsNum (   $result)

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.

Definition at line 204 of file mysqldatabase.php.

References $result, and Xoops\getInstance().

Here is the call graph for this function:

XoopsMySQLDatabase::query (   $sql,
  $limit = 0,
  $start = 0 
)

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
this returns nothing
Deprecated:
since version 2.6.0 - alpha 3. Switch to doctrine connector.

Definition at line 379 of file mysqldatabase.php.

References deprecated().

Referenced by queryFromFile().

Here is the call graph for this function:

Here is the caller graph for this function:

XoopsMySQLDatabase::queryF (   $sql,
  $limit = 0,
  $start = 0 
)

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.

Definition at line 337 of file mysqldatabase.php.

References $limit, $result, $sql, $start, deprecated(), and Xoops\Core\Events\getInstance().

Referenced by XoopsMySQLDatabaseSafe\query(), and XoopsMySQLDatabaseProxy\query().

Here is the call graph for this function:

Here is the caller graph for this function:

XoopsMySQLDatabase::queryFromFile (   $file)

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. Switch to doctrine connector.

Definition at line 394 of file mysqldatabase.php.

References $file, $query, deprecated(), XoopsDatabase\prefix(), SqlUtility\prefixQuery(), query(), and SqlUtility\splitMySqlFile().

Here is the call graph for this function:

XoopsMySQLDatabase::quote (   $string)

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.

Definition at line 303 of file mysqldatabase.php.

References deprecated().

Referenced by escape(), and quoteString().

Here is the call graph for this function:

Here is the caller graph for this function:

XoopsMySQLDatabase::quoteString (   $str)

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.

Definition at line 288 of file mysqldatabase.php.

References deprecated(), and quote().

Here is the call graph for this function:

Member Data Documentation

XoopsMySQLDatabase::$conn

Definition at line 43 of file mysqldatabase.php.

XoopsMySQLDatabase::$connect = false
private

Definition at line 50 of file mysqldatabase.php.

Referenced by connect().

XoopsMySQLDatabase::$lastResult = null
private

Definition at line 36 of file mysqldatabase.php.

XoopsMySQLDatabase::$selectdb
private

Definition at line 57 of file mysqldatabase.php.

Referenced by connect().


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