略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: MysqlndUhPreparedStatement::execute

2024-12-22

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"

参见

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/mysqlnduhpreparedstatement.execute.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3