XCL Web Application Platform 2.5.0
The XoopsCube Legacy Project
Loading...
Searching...
No Matches
XoopsMySQLDatabase Class Reference
Inheritance diagram for XoopsMySQLDatabase:
XoopsMySQLDatabaseProxy XoopsMySQLDatabaseSafe

Public Member Functions

 connect ($selectdb=true)
 
 genId ($sequence)
 
 fetchRow ($result)
 
 fetchArray ($result)
 
 fetchBoth ($result)
 
 getInsertId ()
 
 getRowsNum ($result)
 
 getAffectedRows ()
 
 close ()
 
 freeRecordSet ($result)
 
 error ()
 
 errno ()
 
 quoteString ($str)
 
queryF ($sql, $limit=0, $start=0)
 
query ($sql, $limit=0, $start=0)
 
 queryFromFile ($file)
 
 getFieldName ($result, $offset)
 
 getFieldType ($result, $offset)
 
 getFieldsNum ($result)
 
 prepare ($query)
 
 bind_param ()
 
execute ()
 
executeF ()
 

Data Fields

 $conn
 
 $mPrepareQuery =null
 

Detailed Description

Definition at line 27 of file mysqldatabase.php.

Member Function Documentation

◆ bind_param()

bind_param ( )

Emulates bind_param(), but this is TEST API.

Remarks
This is TEST API. This method should be called by only Legacy.

Definition at line 336 of file mysqldatabase.php.

◆ close()

close ( )

Close MySQL connection

Definition at line 157 of file mysqldatabase.php.

◆ connect()

connect ( $selectdb = true)

connect to the database

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

Definition at line 47 of file mysqldatabase.php.

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

Definition at line 188 of file mysqldatabase.php.

◆ error()

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 178 of file mysqldatabase.php.

◆ execute()

& execute ( )

Executes prepared SQL with query(), but this is TEST API.

Remarks
This is TEST API. This method should be called by only Legacy.

Definition at line 378 of file mysqldatabase.php.

◆ executeF()

& executeF ( )

Executes prepared SQL with queryF(), but this is TEST API.

Remarks
This is TEST API. This method should be called by only Legacy.

Definition at line 389 of file mysqldatabase.php.

◆ fetchArray()

fetchArray ( $result)

Fetch a result row as an associative array

Parameters
$result
Returns
array

Definition at line 106 of file mysqldatabase.php.

◆ fetchBoth()

fetchBoth ( $result)

Fetch a result row as an associative array

Parameters
$result
Returns
array

Definition at line 117 of file mysqldatabase.php.

◆ fetchRow()

fetchRow ( $result)

Get a result row as an enumerated array

Parameters
resource$result
Returns
array

Definition at line 95 of file mysqldatabase.php.

◆ freeRecordSet()

freeRecordSet ( $result)

will free all memory associated with the result identifier result.

Parameters
resourcequery result
Returns
bool TRUE on success or FALSE on failure.

Definition at line 168 of file mysqldatabase.php.

◆ 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

Definition at line 84 of file mysqldatabase.php.

◆ getAffectedRows()

getAffectedRows ( )

Get number of affected rows

Returns
int

Definition at line 148 of file mysqldatabase.php.

◆ getFieldName()

getFieldName ( $result,
$offset )

Get field name

Parameters
resource$resultquery result
intnumerical field index
Returns
string

Definition at line 283 of file mysqldatabase.php.

◆ getFieldsNum()

getFieldsNum ( $result)

Get number of fields in result

Parameters
resource$resultquery result
Returns
int

Definition at line 306 of file mysqldatabase.php.

◆ getFieldType()

getFieldType ( $result,
$offset )

Get field type

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

Definition at line 295 of file mysqldatabase.php.

◆ getInsertId()

getInsertId ( )

Get the ID generated from the previous INSERT operation

Returns
int

Definition at line 127 of file mysqldatabase.php.

◆ getRowsNum()

getRowsNum ( $result)

Get number of rows in result

Parameters
resourcequery result
Returns
int

Definition at line 138 of file mysqldatabase.php.

◆ prepare()

prepare ( $query)

Emulates prepare(), but this is TEST API.

Remarks
This is TEST API. This method should be called by only Legacy.
Parameters
$query

Definition at line 316 of file mysqldatabase.php.

◆ query()

& 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

@abstract

Reimplemented in XoopsMySQLDatabaseProxy, and XoopsMySQLDatabaseSafe.

Definition at line 246 of file mysqldatabase.php.

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

Definition at line 214 of file mysqldatabase.php.

◆ 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

Definition at line 257 of file mysqldatabase.php.

◆ 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

Definition at line 199 of file mysqldatabase.php.

Field Documentation

◆ $conn

$conn

Definition at line 33 of file mysqldatabase.php.

◆ $mPrepareQuery

$mPrepareQuery =null

Definition at line 39 of file mysqldatabase.php.


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