back to mysql 

mysql.Statement

generated from ../src/mod_mysql/stmt.cpp

Keeps the result of a query.

Constants

Properties

Name Type Description
affectedRows read only Integer Returns the total number of rows changed, deleted, or inserted by the last executed statement.
errno read only Integer Returns the error code for the most recently invoked statement.
error read only String Returns a string containing the error message for the most recently invoked statement.
insertId read only Integer Returns the value generated for an AUTO_INCREMENT column by the previous INSERT or UPDATE statement. Use this property after you have performed an INSERT statement into a table that contains an AUTO_INCREMENT field. Note that insertId returns 0 if the previous statement does not use an AUTO_INCREMENT value. If you need to save the value for later, be sure to store the value of insertId in a variable.
paramCount read only Integer Returns the number of parameters in the prepared statement
sqlState read only String Returns a string containing the SQLSTATE error code for the most recently executed SQL statement.

Methods

bind

bind(Bindings) : Boolean
 
Name Type Default Description
Bindings Array
bind(Pos, 
     Value) : Boolean
 
Name Type Default Description
Pos Integer The position of the parameter (zero-indexed)
Value Mixed

The method bind is used to bind input data for the parameter markers in the SQL statement that was passed to prepare.

The array must contain one element for each "?" parameter marker that is present in the query.

execute

execute() : Boolean
 

Executes the prepared statement

fetchArray

fetchArray() : Array
 

Returns the next row as an array.

fetchObject

fetchObject() : Object
 

Returns the next row as an object. The name of the field is used as name of the property.




Design downloaded from Zeroweb.org: Free website templates, layouts, and tools.