MysqlndUhPreparedStatement::execute

(PECL mysqlnd-uh >= 1.0.0-alpha)

MysqlndUhPreparedStatement::executeExecutes a prepared Query

说明

public MysqlndUhPreparedStatement::execute ( mysqlnd_prepared_statement $statement ) : bool

Executes a prepared Query.

参数

statement

Mysqlnd prepared statement handle. Do not modify! Resource of type Mysqlnd Prepared Statement (internal only - you must not modify it!).

返回值

Returns TRUE on success. Otherwise, returns FALSE

范例

Example #1 MysqlndUhPreparedStatement::execute() example

<?php
class 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($rettrue));
  
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);
?>

以上例程会输出:

stmt_proxy::execute(resource(256) of type (Mysqlnd Prepared Statement (internal only - you must not modify it!))
)
stmt_proxy::execute returns true
bool(true)
string(8) "Labskaus"

参见

相关文章
php ibm db2 函数 executes a prepared sql statementphp firebird/interbase 函数 execute a previously prepared queryphp firebird/interbase 函数 free memory allocated by a prepared queryphp firebird/interbase 函数 return the number of parameters in a prepared queryphp firebird/interbase 函数 return information about a parameter in a prepared queryphp ingres 函数 execute a prepared queryphp maxdb 函数 executes a prepared queryphp sqlite 函数 executes a result less query against a given databasephp sqlite 函数 executes a query against a given database and returns a result handlephp sqlite 函数 executes a query and returns either an array for one single column or the value of the first rowphp sqlsrv 函数 executes a statement prepared with sqlsrv preparephp sqlsrv 函数 retrieves metadata for the fields of a statement prepared by sqlsrv prepare or sqlsrv queryphp sqlsrv 函数 prepares and executes a queryphp mysqli stmt executes a prepared queryphp mysqlnduhpreparedstatement executes a prepared queryphp sdo das relational 函数 executes an sql query passed as a prepared statement with a list of values to substitute for placeholders and return the results as a normalised data graphphp sdo das relational 函数 executes a given sql query against a relational database and returns the results as a normalised data graphphp sqlite3 executes an sql queryphp sqlite3 executes a query and returns a single resultphp sqlite3stmt executes a prepared statement and returns a result set object
关注编程学问公众号