Im' getting this warning "property access is not allowed yet" when trying to close mysqli connection. WHY?
$mysqli = new mysqli ( $database ["dbUri"], $database ["dbUserName"], $database ["dbPassword"], $database ["dbSchema"], $database ["dbPort"] );
$mysqli->autocommit(FALSE);
$con = $mysqli;
$rowsAffected = /* completes insert using $con */;
if ($rowsAffected==0) {
throw new Exception("Insert of new record failed");
}
$insertId = $con->insert_id;
$con->commit();
$con->close();
BTW, the insert is successful and I have the correct value in $insertId. Commit works well too, but it's the close that triggers the warning.
I hid the code in /* completes insert using $con */
section as it is long and irrelevant (the sql works). So unless you think it is relevant I only included the rest.
I looked at similar questions but other posts refer to the connection not being established. However, my connection works. PLEASE see the point about "insert is successful".
As far as my analysis of this intermittent problem has concluded (at least in my case), this is some kind of bug in either the mysqli extension or the PHP debugger (XDebug), since it only happens when I breakpoint/single-step the program, but not when simply running the same code without breakpointing/single-stepping any code before the page rendering has completed.
Does it still happen for you if you don't breakpoint or single-step any code before the page rendering is complete?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With