|
Spec-Zone .ru
спецификации, руководства, описания, API
|
Copyright 1997-2012 the PHP Documentation Group.
MysqlndUhPreparedStatement {
MysqlndUhPreparedStatementMethodspublic MysqlndUhPreparedStatement::__construct();public bool MysqlndUhPreparedStatement::execute(mysqlnd_prepared_statement statement);public bool MysqlndUhPreparedStatement::prepare(mysqlnd_prepared_statement statement,
string query);
}
Copyright 1997-2012 the PHP Documentation Group.
MysqlndUhPreparedStatement::__construct
The __construct purpose
Description
public MysqlndUhPreparedStatement::__construct();
This function iscurrently not documented; only its argument list is available.
Parameters
This function has no parameters.
Return Values
Copyright 1997-2012 the PHP Documentation Group.
MysqlndUhPreparedStatement::execute
Executes a prepared Query
Description
public bool MysqlndUhPreparedStatement::execute(mysqlnd_prepared_statement statement);
Executes a prepared Query.
Parameters
statement
Mysqlnd prepared statement handle. Do not modify! Resource of type Mysqlnd
Prepared Statement (internal only - you must not modify it!).
Return Values
Returns TRUE on success. Otherwise, returns FALSE
Examples
Example 22.389. MysqlndUhPreparedStatement::executeexample
<?phpclass stmt_proxy extends MysqlndUhPreparedStatement { public function execute($res) { printf("%s(", __METHOD__); var_dump($res); printf(")\n"); $ret = parent::execute($res); printf("%s returns %s\n", __METHOD__, var_export($ret, true)); var_dump($ret); return $ret; }}mysqlnd_uh_set_statement_proxy(new stmt_proxy());$mysqli = new mysqli("localhost", "root", "", "test");$stmt = $mysqli->prepare("SELECT 'Labskaus' AS _msg FROM DUAL");$stmt->execute();$msg = NULL;$stmt->bind_result($msg);$stmt->fetch();var_dump($msg);?>
The above example will output:
stmt_proxy::execute(resource(256) of type (Mysqlnd Prepared Statement (internal only - you must not modify it!)))stmt_proxy::execute returns truebool(true)string(8) "Labskaus"
See Also
mysqlnd_uh_set_statement_proxy
|
mysqli_stmt_execute
|
Copyright 1997-2012 the PHP Documentation Group.
MysqlndUhPreparedStatement::prepare
Prepare an SQL statement for execution
Description
public bool MysqlndUhPreparedStatement::prepare(mysqlnd_prepared_statement statement,
string query);
Prepare an SQL statement for execution.
Parameters
statement
Mysqlnd prepared statement handle. Do not modify! Resource of type Mysqlnd
Prepared Statement (internal only - you must not modify it!).
query The query to be prepared.
Return Values
Returns TRUE on success. Otherwise, returns FALSE
Examples
Example 22.390. MysqlndUhPreparedStatement::prepareexample
<?phpclass stmt_proxy extends MysqlndUhPreparedStatement { public function prepare($res, $query) { printf("%s(%s)\n", __METHOD__, var_export(func_get_args(), true)); $query = "SELECT 'No more you-know-what-I-mean for lunch, please' AS _msg FROM DUAL"; $ret = parent::prepare($res, $query); printf("%s returns %s\n", __METHOD__, var_export($ret, true)); var_dump($ret); return $ret; }}mysqlnd_uh_set_statement_proxy(new stmt_proxy());$mysqli = new mysqli("localhost", "root", "", "test");$stmt = $mysqli->prepare("SELECT 'Labskaus' AS _msg FROM DUAL");$stmt->execute();$msg = NULL;$stmt->bind_result($msg);$stmt->fetch();var_dump($msg);?>
The above example will output:
stmt_proxy::prepare(array ( 0 => NULL, 1 => 'SELECT \'Labskaus\' AS _msg FROM DUAL',))stmt_proxy::prepare returns truebool(true)string(46) "No more you-know-what-I-mean for lunch, please"
See Also
mysqlnd_uh_set_statement_proxy
|
mysqli_stmt_prepare
|
mysqli_prepare
|