Commands out of sync; you can't run this command now (with free_result()) |
Here is the code:
$sql = "call getCase('$myTable', '$casenum', '$fname','$lname')"; $q = $this->db->query($sql); $data['hrg'] = $q->result(); // $hrgs $q->free_result(); // http://www.codeigniter.com/user_guide/da...sults.html When I execute the next query I get the commands out of sync error. It looks to me like it is coded correctly. Any ideas of the problem?
See this on my website:
http://community-auth.com/blog-posts/com...procedures PHP Code: $sql = "call getCase( '$myTable', '$casenum', '$fname', '$lname')";
My solution.
\system\database\DB_result.php .... public function result_array() { ..... is_null($this->row_data) OR $this->data_seek(0); if($this->conn_id->affected_rows > 0) {// My custom while ($row = $this->_fetch_assoc()) { $this->result_array[] = $row; } $this->free_result(); // My custom @mysqli_next_result($this->conn_id); // My custom } return $this->result_array; }
You should never edit and write to a CodeIgniter system file NEVER!
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(08-27-2016, 10:32 AM)InsiteFX Wrote: You should never edit and write to a CodeIgniter system file NEVER! so it would be best practice then to extend and/or override the method in DB_Driver, then? --- OM
OM...
------------------------- And on the pedestal these words appear: 'My name is Ozymandias, king of kings: Look on my works, ye Mighty, and despair!' Nothing beside remains. Round the decay Of that colossal wreck, boundless and bare The lone and level sands stretch far away.
Correct, the CodeIgniter system folder should never be touched because of updating it by coping the the new system folder over the old one.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(08-29-2016, 09:22 AM)ozzy mandiaz Wrote:(08-27-2016, 10:32 AM)InsiteFX Wrote: You should never edit and write to a CodeIgniter system file NEVER! Good luck with that. Unless something changed, extending the database classes has never been easy. |
Welcome Guest, Not a member yet? Register Sign In |