API - XOOPS 2.5.11 Beta 2
By monxoops.fr
XoopsMySQLDatabase Class Reference
Inheritance diagram for XoopsMySQLDatabase:
Collaboration diagram for XoopsMySQLDatabase:

Public Member Functions

 connect ($selectdb=true)
 
 genId ($sequence)
 
 fetchRow ($result)
 
 fetchArray ($result)
 
 fetchBoth ($result)
 
 fetchObject ($result)
 
 getInsertId ()
 
 getRowsNum ($result)
 
 getAffectedRows ()
 
 close ()
 
 freeRecordSet ($result)
 
 error ()
 
 errno ()
 
 quoteString ($str)
 
 quote ($string)
 
 escape ($string)
 
 queryF ($sql, $limit=0, $start=0)
 
 query ($sql, $limit=0, $start=0)
 
 queryFromFile ($file)
 
 getFieldName ($result, $offset)
 
 getFieldType ($result, $offset)
 
 getFieldsNum ($result)
 
 getServerVersion ()
 
 isResultSet ($result)
 
- Public Member Functions inherited from XoopsDatabase
 __construct ()
 
 setLogger (XoopsLogger $logger)
 
 setPrefix ($value)
 
 prefix ($tablename='')
 
 isResultSet ($result)
 

Data Fields

 $conn
 
- Data Fields inherited from XoopsDatabase
 $prefix = ''
 
 $logger
 
 $allowWebChanges = false
 

Member Function Documentation

◆ close()

close ( )

Close MySQL connection

Returns
void

◆ connect()

connect (   $selectdb = true)

connect to the database

Parameters
bool$selectdbselect the database now?
Returns
bool successful?
Here is the call graph for this function:

◆ errno()

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.
Here is the caller graph for this function:

◆ error()

error ( )

Returns the text of the error message from previous MySQL operation

Returns
string Returns the error text from the last MySQL function, or '' (the empty string) if no error occurred.
Here is the caller graph for this function:

◆ escape()

escape (   $string)

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

Parameters
string$stringstring to escape
Returns
string
Here is the caller graph for this function:

◆ fetchArray()

fetchArray (   $result)

Fetch a result row as an associative array

Parameters
mysqli_result$result
Returns
array|false false on end of data

◆ fetchBoth()

fetchBoth (   $result)

Fetch a result row as an associative array

Parameters
mysqli_result$result
Returns
array|false false on end of data

◆ fetchObject()

fetchObject (   $result)

XoopsMySQLiDatabase::fetchObjected()

Parameters
mixed$result
Returns
stdClass|false false on end of data

◆ fetchRow()

fetchRow (   $result)

Get a result row as an enumerated array

Parameters
mysqli_result$result
Returns
array|false false on end of data

◆ freeRecordSet()

freeRecordSet (   $result)

will free all memory associated with the result identifier result.

Parameters
mysqli_result$resultresult
Returns
void

◆ genId()

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

◆ getAffectedRows()

getAffectedRows ( )

Get number of affected rows

Returns
int

◆ getFieldName()

getFieldName (   $result,
  $offset 
)

Get field name

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

◆ getFieldsNum()

getFieldsNum (   $result)

Get number of fields in result

Parameters
mysqli_result$resultquery result
Returns
int

◆ getFieldType()

getFieldType (   $result,
  $offset 
)

Get field type

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

◆ getInsertId()

getInsertId ( )

Get the ID generated from the previous INSERT operation

Returns
int|string

◆ getRowsNum()

getRowsNum (   $result)

Get number of rows in result

Parameters
mysqli_result$result
Returns
int

◆ getServerVersion()

getServerVersion ( )

getServerVersion get version of the mysql server

Returns
string

◆ isResultSet()

isResultSet (   $result)

Test the passed result to determine if it is a valid result set

Parameters
mixed$resultvalue to test
Returns
bool true if $result is a database result set, otherwise false

Reimplemented from XoopsDatabase.

◆ query()

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

Reimplemented in XoopsMySQLDatabaseSafe, XoopsMySQLDatabaseProxy, and ProtectorMySQLDatabase.

Here is the caller graph for this function:

◆ queryF()

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
mysqli_result|bool query result or FALSE if successful or TRUE if successful and no result
Here is the call graph for this function:
Here is the caller graph for this function:

◆ queryFromFile()

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
Here is the call graph for this function:

◆ quote()

quote (   $string)

Quotes a string for use in a query.

Parameters
string$stringstring to quote/escape for use in query
Returns
string
Here is the call graph for this function:
Here is the caller graph for this function:

◆ quoteString()

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
Here is the call graph for this function:

Field Documentation

◆ $conn

$conn

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