Executes a prepared Query

MysqlndUhPreparedStatement::__construct
MysqlndUhPreparedStatement::prepare
MysqlndUhPreparedStatement
PHP Manual

# MysqlndUhPreparedStatement::execute

(PECL mysqlnd-uh >= 1.0.0-alpha)

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 #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($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 true
    bool(true)
    string(8) "Labskaus"

### See Also

- mysqlnd_uh_set_statement_proxy() - Installs a proxy for mysqlnd statements
- mysqli_stmt_execute() - Executes a prepared Query

MysqlndUhPreparedStatement::__construct
MysqlndUhPreparedStatement::prepare
MysqlndUhPreparedStatement
PHP Manual