This code is in a file being run as ajax. Trying to obtain the count of affected rows causes a failure. I get no error message, and the try .. catch doesn't catch it either. What could be going on? I'll blame it on the ajax since code like this works everyplace else.
Also this returns false: var_dump(method_exists($q,'affected_rows')); // returns false
Can that be? Wouldn't a query always have that method? Or isn't it a method?
Also this returns false: var_dump(method_exists($q,'affected_rows')); // returns false
Can that be? Wouldn't a query always have that method? Or isn't it a method?
Code:
$q = $mysqli->query($sql);
if (is_object($q))
echo "this is as far as it goes.............";
else
echo "not object";
$rowsAffected = $q->affected_rows(); // <== this is where it fails
echo "rows returned: "; // .$rowsAffected; // fails on this and says nothing about it.
return true;