XOOPS 2.5.6  Final
 All Classes Namespaces Files Functions Variables Pages
XoopsMySQLDatabase Class Reference
Inheritance diagram for XoopsMySQLDatabase:
Inheritance graph

Public Member Functions

 close ()
 
 connect ($selectdb=TRUE)
 
 errno ()
 
 error ()
 
 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
 prefix ($tablename= '')
 
 setLogger (&$logger)
 
 setPrefix ($value)
 
 XoopsDatabase ()
 

Public Attributes

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

Detailed Description

Definition at line 44 of file mysqldatabase.php.

Member Function Documentation

XoopsMySQLDatabase::close ( )

Close MySQL connection

Definition at line 184 of file mysqldatabase.php.

XoopsMySQLDatabase::connect (   $selectdb = TRUE)

connect to the database

Parameters
bool$selectdbselect the database now?
Returns
bool successful?

Definition at line 59 of file mysqldatabase.php.

References $_SERVER, XOOPS_DB_CHARSET, XOOPS_DB_HOST, XOOPS_DB_NAME, XOOPS_DB_PASS, XOOPS_DB_PCONNECT, and XOOPS_DB_USER.

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.

Definition at line 215 of file mysqldatabase.php.

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.

Definition at line 205 of file mysqldatabase.php.

XoopsMySQLDatabase::fetchArray (   $result)

Fetch a result row as an associative array

Returns
array

Definition at line 124 of file mysqldatabase.php.

References $result.

XoopsMySQLDatabase::fetchBoth (   $result)

Fetch a result row as an associative array

Returns
array

Definition at line 134 of file mysqldatabase.php.

References $result.

XoopsMySQLDatabase::fetchObject (   $result)

XoopsMySQLDatabase::fetchObjected()

Parameters
mixed$result
Returns

Definition at line 145 of file mysqldatabase.php.

References $result.

XoopsMySQLDatabase::fetchRow (   $result)

Get a result row as an enumerated array

Parameters
resource$result
Returns
array

Definition at line 114 of file mysqldatabase.php.

References $result.

XoopsMySQLDatabase::freeRecordSet (   $result)

will free all memory associated with the result identifier result.

Parameters
resource$ query result
Returns
bool TRUE on success or FALSE on failure.

Definition at line 195 of file mysqldatabase.php.

References $result.

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

Definition at line 103 of file mysqldatabase.php.

XoopsMySQLDatabase::getAffectedRows ( )

Get number of affected rows

Returns
int

Definition at line 176 of file mysqldatabase.php.

XoopsMySQLDatabase::getFieldName (   $result,
  $offset 
)

Get field name

Parameters
resource$resultquery result
int$ numerical field index
Returns
string

Definition at line 316 of file mysqldatabase.php.

References $result.

XoopsMySQLDatabase::getFieldsNum (   $result)

Get number of fields in result

Parameters
resource$resultquery result
Returns
int

Definition at line 339 of file mysqldatabase.php.

References $result.

XoopsMySQLDatabase::getFieldType (   $result,
  $offset 
)

Get field type

Parameters
resource$resultquery result
int$offsetnumerical field index
Returns
string

Definition at line 328 of file mysqldatabase.php.

References $result.

XoopsMySQLDatabase::getInsertId ( )

Get the ID generated from the previous INSERT operation

Returns
int

Definition at line 155 of file mysqldatabase.php.

XoopsMySQLDatabase::getRowsNum (   $result)

Get number of rows in result

Parameters
resource$ query result
Returns
int

Definition at line 166 of file mysqldatabase.php.

References $result.

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

Definition at line 280 of file mysqldatabase.php.

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
resource query result or FALSE if successful or TRUE if successful and no result

Definition at line 248 of file mysqldatabase.php.

References $limit, $result, $sql, and $start.

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

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

Definition at line 290 of file mysqldatabase.php.

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

Here is the call graph for this function:

XoopsMySQLDatabase::quote (   $string)

Quotes a string for use in a query.

Definition at line 234 of file mysqldatabase.php.

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

Definition at line 226 of file mysqldatabase.php.

Member Data Documentation

XoopsMySQLDatabase::$conn

Definition at line 51 of file mysqldatabase.php.


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