Joomla CMS  4.2.2
Documentation des API du CMS Joomla en version 4.2.2
Référence de l'interface StatementInterface
+ Graphe d'héritage de StatementInterface:

Fonctions membres publiques

 bindParam ($parameter, &$variable, string $dataType=ParameterType::STRING, ?int $length=null, ?array $driverOptions=null)
 
 closeCursor ()
 
 errorCode ()
 
 errorInfo ()
 
 execute (?array $parameters=null)
 
 fetch (?int $fetchStyle=null, int $cursorOrientation=FetchOrientation::NEXT, int $cursorOffset=0)
 
 rowCount ()
 
 setFetchMode (int $fetchMode,... $args)
 

Description détaillée

Interface defining a query statement.

This interface is a partial standalone implementation of PDOStatement.

Depuis
2.0.0

Documentation des fonctions membres

◆ bindParam()

bindParam (   $parameter,
$variable,
string  $dataType = ParameterType::STRING,
?int  $length = null,
?array  $driverOptions = null 
)

Binds a parameter to the specified variable name.

Paramètres
string | integer$parameterParameter identifier. For a prepared statement using named placeholders, this will be a parameter name of the form :name. For a prepared statement using question mark placeholders, this will be the 1-indexed position of the parameter.
mixed$variableName of the PHP variable to bind to the SQL statement parameter.
string$dataTypeConstant corresponding to a SQL datatype, this should be the processed type from the QueryInterface.
integer$lengthThe length of the variable. Usually required for OUTPUT parameters.
array$driverOptionsOptional driver options to be used.
Renvoie
boolean
Depuis
2.0.0

Implémenté dans SqlsrvStatement, MysqliStatement, et PdoStatement.

◆ closeCursor()

closeCursor ( )

Closes the cursor, enabling the statement to be executed again.

Renvoie
void
Depuis
2.0.0

Implémenté dans MysqliStatement, SqlsrvStatement, et PdoStatement.

◆ errorCode()

errorCode ( )

Fetches the SQLSTATE associated with the last operation on the statement handle.

Renvoie
string
Depuis
2.0.0

Implémenté dans MysqliStatement, SqlsrvStatement, et PdoStatement.

◆ errorInfo()

errorInfo ( )

Fetches extended error information associated with the last operation on the statement handle.

Renvoie
array
Depuis
2.0.0

Implémenté dans SqlsrvStatement, MysqliStatement, et PdoStatement.

◆ execute()

execute ( ?array  $parameters = null)

Executes a prepared statement

Paramètres
array | null$parametersAn array of values with as many elements as there are bound parameters in the SQL statement being executed.
Renvoie
boolean
Depuis
2.0.0

Implémenté dans SqlsrvStatement, MysqliStatement, et PdoStatement.

◆ fetch()

fetch ( ?int  $fetchStyle = null,
int  $cursorOrientation = FetchOrientation::NEXT,
int  $cursorOffset = 0 
)

Fetches the next row from a result set

Paramètres
integer | null$fetchStyleControls how the next row will be returned to the caller. This value must be one of the FetchMode constants, defaulting to value of FetchMode::MIXED.
integer$cursorOrientationFor a StatementInterface object representing a scrollable cursor, this value determines which row will be returned to the caller. This value must be one of the FetchOrientation constants, defaulting to FetchOrientation::NEXT.
integer$cursorOffsetFor a StatementInterface object representing a scrollable cursor for which the cursorOrientation parameter is set to FetchOrientation::ABS, this value specifies the absolute number of the row in the result set that shall be fetched. For a StatementInterface object representing a scrollable cursor for which the cursorOrientation parameter is set to FetchOrientation::REL, this value specifies the row to fetch relative to the cursor position before fetch() was called.
Renvoie
mixed The return value of this function on success depends on the fetch type. In all cases, boolean false is returned on failure.
Depuis
2.0.0

Implémenté dans MysqliStatement, SqlsrvStatement, et PdoStatement.

◆ rowCount()

rowCount ( )

Returns the number of rows affected by the last SQL statement.

Renvoie
integer
Depuis
2.0.0

Implémenté dans MysqliStatement, SqlsrvStatement, et PdoStatement.

◆ setFetchMode()

setFetchMode ( int  $fetchMode,
  $args 
)

Sets the fetch mode to use while iterating this statement.

Paramètres
integer$fetchModeThe fetch mode, must be one of the FetchMode constants.
mixed...$args Optional mode-specific arguments.
Renvoie
void
Depuis
2.0.0

Implémenté dans MysqliStatement, SqlsrvStatement, et PdoStatement.


La documentation de cette interface a été générée à partir du fichier suivant :