0

I try to install mysqlnd_uh_set_connection_proxy() to monitor sql query. However, It doesn't work. It shows a warning.

Warning: mysqlnd_uh_set_connection_proxy(): (Mysqlnd User Handler) You must be using mysqli with mysqlnd. This extension is a mysqlnd plugin. in /var/www/html/test.php on line 15

What should I do? Here is the source code I used:

<?php
class conn_proxy extends MysqlndUhConnection {
 public function query($res, $query) {
  debug_print_backtrace();
  return parent::query($res, $query);
 }
}
class stmt_proxy extends MysqlndUhPreparedStatement {
 public function prepare($res, $query) {
  debug_print_backtrace();
  return parent::prepare($res, $query);
 }
}
mysqlnd_uh_set_connection_proxy(new conn_proxy());
mysqlnd_uh_set_statement_proxy(new stmt_proxy());

printf("Proxies installed...\n");

$mysqli = new mysqli("localhost", "root", "root", "shoppingcart");
$mysqli->prepare("SELECT 1 AS _two FROM DUAL");
?>
2
  • What should I do? Show us your actual code maybe?
    – Alon Eitan
    May 7, 2017 at 16:55
  • The code is from Php.net to monitor sql query.
    – NickNguyen
    May 7, 2017 at 19:16

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.