Hi!
I am having problems finding out the number of rows in the result set, when using prepared statements and bound results.
The manual says I should use stored result set, but that is not, as far as I can see, compatible with prepared statements since two separate objects are being used. Here's the code.
//...
$dbStmt= $dbMysqli->prepare('SELECT a, b FROM table WHERE c=? AND d=?');
$dbStmt->bind_param('ii', $c, $d);
$dbStmt->execute();
$dbStmt->bind_result($a, $b);
// Need number of rows here, before the loop begins
while ($dbStmt->fetch()) {
// Do someting with returned data
}
//...