XCL Web Application Platform 2.5.0
The XoopsCube Legacy Project
Loading...
Searching...
No Matches
XoopsMysqliDatabase Class Reference
Inheritance diagram for XoopsMysqliDatabase:
XoopsMysqliDatabaseProxy XoopsMysqliDatabaseSafe

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)
 
 setCharset ($charset)
 
 prepare ($query)
 
 bind_param ()
 
execute ()
 
executeF ()
 

Data Fields

 $conn
 
 $mPrepareQuery =null
 

Detailed Description

Definition at line 24 of file mysqlidatabase.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 355 of file mysqlidatabase.php.

◆ close()

close ( )

Close MySQL connection

Definition at line 156 of file mysqlidatabase.php.

◆ connect()

connect ( $selectdb = true)

connect to the database

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

Definition at line 44 of file mysqlidatabase.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 187 of file mysqlidatabase.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 177 of file mysqlidatabase.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 397 of file mysqlidatabase.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 408 of file mysqlidatabase.php.

◆ fetchArray()

fetchArray ( $result)

Fetch a result row as an associative array

Parameters
$result
Returns
array

Definition at line 105 of file mysqlidatabase.php.

◆ fetchBoth()

fetchBoth ( $result)

Fetch a result row as an associative array

Parameters
$result
Returns
array

Definition at line 116 of file mysqlidatabase.php.

◆ fetchRow()

fetchRow ( $result)

Get a result row as an enumerated array

Parameters
mysqli_result$result
Returns
array|null

Definition at line 94 of file mysqlidatabase.php.

◆ freeRecordSet()

freeRecordSet ( $result)

will free all memory associated with the result identifier result.

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

Definition at line 167 of file mysqlidatabase.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 83 of file mysqlidatabase.php.

◆ getAffectedRows()

getAffectedRows ( )

Get number of affected rows

Returns
int

Definition at line 147 of file mysqlidatabase.php.

◆ getFieldName()

getFieldName ( $result,
$offset )

Get field name

Parameters
mysqli_result$result
intnumerical field index
Returns
string

Definition at line 283 of file mysqlidatabase.php.

◆ getFieldsNum()

getFieldsNum ( $result)

Get number of fields in result

Parameters
mysqli_result$result
Returns
int

Definition at line 314 of file mysqlidatabase.php.

◆ getFieldType()

getFieldType ( $result,
$offset )

Get field type

Parameters
mysqli_result$result
int$offsetnumerical field index
Returns
string

Definition at line 299 of file mysqlidatabase.php.

◆ getInsertId()

getInsertId ( )

Get the ID generated from the previous INSERT operation

Returns
int

Definition at line 126 of file mysqlidatabase.php.

◆ getRowsNum()

getRowsNum ( $result)

Get number of rows in result

Parameters
resourcequery result
Returns
int

Definition at line 137 of file mysqlidatabase.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 335 of file mysqlidatabase.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 XoopsMysqliDatabaseProxy, and XoopsMysqliDatabaseSafe.

Definition at line 246 of file mysqlidatabase.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
bool|\mysqli_result query result or FALSE if successful or TRUE if successful and no result

Definition at line 213 of file mysqlidatabase.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 mysqlidatabase.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 198 of file mysqlidatabase.php.

◆ setCharset()

setCharset ( $charset)

Sets the default client character set

Parameters
string$charsetThe charset to be set as default
Returns
bool

Definition at line 325 of file mysqlidatabase.php.

Field Documentation

◆ $conn

$conn

Definition at line 30 of file mysqlidatabase.php.

◆ $mPrepareQuery

$mPrepareQuery =null

Definition at line 36 of file mysqlidatabase.php.


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