0

After doing a MySQL CALL statement in PHP, which successfully returns the result, any following query returns only a boolean(false), on which I obviously can't call fetch_all(). Both queries worked fine when I tested them in phpmyadmin.

Fatal error: Uncaught Error: Call to a member function fetch_all() on bool

$connection = new mysqli(<domain>, <user>, <password>, <database>);

$a = $connection->query("CALL userIDByUsername('server')");
print_r($a->fetch_all());
$a->close();

$b = $connection->query("SELECT * FROM useridentification WHERE username = 'server'");
print_r($b->fetch_all());
$b->close();

$connection->close();

EDIT: After adding

mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);

I get the error message

Fatal error: Uncaught mysqli_sql_exception: Commands out of sync; you can't run this command now

bdk02
  • 1
  • 2

0 Answers0