Commands out of sync; you can't run this command now [SOLVED] |
OK, so I've tried everything in https://dev.mysql.com/doc/refman/8.0/en/...-sync.html (see above) but maybe I'm not calling those commands correctly? I've tried:
$result = $this->db->store_result(); $this->db->free_result(); also tried: if ($result = $this->mysqli->store_result()) { while ($row = $result->fetch_assoc()) { $this->Data[$i][] = $row; } //mysqli_free_result($result); this didn't do anything $this->mysqli->free_result($result) //this didn't either } also tried calling this after each query: public function clearStoredResults(){ $db_id = $this->db->conn_id; do { if ($res = $this->db->call_function("store_result", $db_id)) { $res->free(); } } while ($this->db->call_function("more_results", $db_id) && $this->db->call_function("next_result", $db_id)); } Also tried updating the _execute code in this system folder according to: https://stackoverflow.com/questions/3632...sync-error Also tried after each query: $this->free_result(); function free_result() { while (mysqli_more_results($this->conn) && mysqli_next_result($this->conn)) { $dummyResult = mysqli_use_result($this->conn); if ($dummyResult instanceof mysqli_result) { mysqli_free_result($this->conn); } } } Still no luck. Now I'm not even getting an error message, I just get my messages I've added myself using log_message. I get successfully logged messages after every line, up until I try to get a result using: $result=$this->db->get('tblProgram')->result(); Then the logs are blank and I eventually get a 500 Server Error (sometimes I then get repeated 500 server errors for minutes after trying to refresh the page) I've also tried just writing out my query to the console, and not getting results using $result=$this->db->get('tblProgram')->result(); to make sure the query is correct. The query is coming back as a successful query I can run on the database. Any other suggestions? |
Messages In This Thread |
Commands out of sync; you can't run this command now [SOLVED] - by xanabobana - 11-21-2022, 03:29 PM
RE: Commands out of sync; you can't run this command now - by InsiteFX - 11-22-2022, 01:25 AM
RE: Commands out of sync; you can't run this command now - by xanabobana - 11-22-2022, 12:54 PM
RE: Commands out of sync; you can't run this command now - by InsiteFX - 11-22-2022, 11:23 PM
RE: Commands out of sync; you can't run this command now - by xanabobana - 11-23-2022, 11:00 AM
RE: Commands out of sync; you can't run this command now - by InsiteFX - 11-24-2022, 01:32 AM
RE: Commands out of sync; you can't run this command now - by rodrigoguariento - 12-13-2024, 02:39 PM
RE: Commands out of sync; you can't run this command now - by InsiteFX - 12-13-2024, 09:17 PM
|