PHP Class PMA\libraries\dbi\DBIMysqli

Inheritance: implements PMA\libraries\dbi\DBIExtension
Show file Open project: phpmyadmin/phpmyadmin

Public Methods

Method Description
affectedRows ( mysqli $link ) : integer returns the number of rows affected by last query
connect ( string $user, string $password, array $server ) : mixed connects to the database server
dataSeek ( mysqli_result $result, integer $offset ) : boolean Adjusts the result pointer to an arbitrary row in the result
escapeString ( mixed $link, string $str ) : string returns properly escaped string for use in MySQL queries
fetchArray ( mysqli_result $result ) : array returns array of rows with associative and numeric keys from $result
fetchAssoc ( mysqli_result $result ) : array returns array of rows with associative keys from $result
fetchRow ( mysqli_result $result ) : array returns array of rows with numeric keys from $result
fieldFlags ( mysqli_result $result, integer $i ) : string returns concatenated string of human readable field flags
fieldLen ( mysqli_result $result, integer $i ) : integer returns the length of the given field $i in $result
fieldName ( mysqli_result $result, integer $i ) : string returns name of $i. field in $result
freeResult ( mysqli_result $result ) : void Frees memory associated with the result
getClientInfo ( ) : string returns a string that represents the client library version
getError ( resource $link ) : string | boolean returns last error message or false if no errors occurred
getFieldsMeta ( mysqli_result $result ) : array returns metainfo for fields in $result
getHostInfo ( resource $link ) : string Returns a string representing the type of connection used
getProtoInfo ( resource $link ) : integer Returns the version of the MySQL protocol used
moreResults ( mysqli $link ) : boolean Check if there are any more query results from a multi query
nextResult ( mysqli $link ) : boolean Prepare next result from multi_query
numFields ( mysqli_result $result ) : integer return number of fields in given $result
numRows ( mysqli_result $result ) : string | integer returns the number of rows returned by last query
realMultiQuery ( mysqli $link, string $query ) : mysqli_result Run the multi query and output the results
realQuery ( string $query, mysqli $link, integer $options ) : mysqli_result | boolean runs a query and returns the result
selectDb ( string $dbname, mysqli $link ) : boolean selects given database
storeResult ( mysqli $link ) : mixed Store the result returned from multi query

Private Methods

Method Description
_realConnect ( mysqli $link, string $host, string $user, string $password, integer $server_port, string $server_socket, integer $client_flags = null, boolean $persistent = false ) : boolean Helper function for connecting to the database server

Method Details

affectedRows() public method

returns the number of rows affected by last query
public affectedRows ( mysqli $link ) : integer
$link mysqli the mysqli object
return integer

connect() public method

connects to the database server
public connect ( string $user, string $password, array $server ) : mixed
$user string mysql user name
$password string mysql user password
$server array host/port/socket/persistent
return mixed false on error or a mysqli object on success

dataSeek() public method

Adjusts the result pointer to an arbitrary row in the result
public dataSeek ( mysqli_result $result, integer $offset ) : boolean
$result mysqli_result database result
$offset integer offset to seek
return boolean true on success, false on failure

escapeString() public method

returns properly escaped string for use in MySQL queries
public escapeString ( mixed $link, string $str ) : string
$link mixed database link
$str string string to be escaped
return string a MySQL escaped string

fetchArray() public method

returns array of rows with associative and numeric keys from $result
public fetchArray ( mysqli_result $result ) : array
$result mysqli_result result set identifier
return array

fetchAssoc() public method

returns array of rows with associative keys from $result
public fetchAssoc ( mysqli_result $result ) : array
$result mysqli_result result set identifier
return array

fetchRow() public method

returns array of rows with numeric keys from $result
public fetchRow ( mysqli_result $result ) : array
$result mysqli_result result set identifier
return array

fieldFlags() public method

returns concatenated string of human readable field flags
public fieldFlags ( mysqli_result $result, integer $i ) : string
$result mysqli_result result set identifier
$i integer field
return string field flags

fieldLen() public method

returns the length of the given field $i in $result
public fieldLen ( mysqli_result $result, integer $i ) : integer
$result mysqli_result result set identifier
$i integer field
return integer length of field

fieldName() public method

returns name of $i. field in $result
public fieldName ( mysqli_result $result, integer $i ) : string
$result mysqli_result result set identifier
$i integer field
return string name of $i. field in $result

freeResult() public method

Frees memory associated with the result
public freeResult ( mysqli_result $result ) : void
$result mysqli_result database result
return void

getClientInfo() public method

returns a string that represents the client library version
public getClientInfo ( ) : string
return string MySQL client library version

getError() public method

returns last error message or false if no errors occurred
public getError ( resource $link ) : string | boolean
$link resource mysql link
return string | boolean $error or false

getFieldsMeta() public method

returns metainfo for fields in $result
public getFieldsMeta ( mysqli_result $result ) : array
$result mysqli_result result set identifier
return array meta info for fields in $result

getHostInfo() public method

Returns a string representing the type of connection used
public getHostInfo ( resource $link ) : string
$link resource mysql link
return string type of connection used

getProtoInfo() public method

Returns the version of the MySQL protocol used
public getProtoInfo ( resource $link ) : integer
$link resource mysql link
return integer version of the MySQL protocol used

moreResults() public method

Check if there are any more query results from a multi query
public moreResults ( mysqli $link ) : boolean
$link mysqli the mysqli object
return boolean true or false

nextResult() public method

Prepare next result from multi_query
public nextResult ( mysqli $link ) : boolean
$link mysqli the mysqli object
return boolean true or false

numFields() public method

return number of fields in given $result
public numFields ( mysqli_result $result ) : integer
$result mysqli_result result set identifier
return integer field count

numRows() public method

returns the number of rows returned by last query
public numRows ( mysqli_result $result ) : string | integer
$result mysqli_result result set identifier
return string | integer

realMultiQuery() public method

Run the multi query and output the results
public realMultiQuery ( mysqli $link, string $query ) : mysqli_result
$link mysqli mysqli object
$query string multi query statement to execute
return mysqli_result collection | boolean(false)

realQuery() public method

runs a query and returns the result
public realQuery ( string $query, mysqli $link, integer $options ) : mysqli_result | boolean
$query string query to execute
$link mysqli mysqli object
$options integer query options
return mysqli_result | boolean

selectDb() public method

selects given database
public selectDb ( string $dbname, mysqli $link ) : boolean
$dbname string database name to select
$link mysqli the mysqli object
return boolean

storeResult() public method

Store the result returned from multi query
public storeResult ( mysqli $link ) : mixed
$link mysqli the mysqli object
return mixed false when empty results / result set when not empty