@@ -218,14 +218,14 @@ public function setPrefix($prefix = '')
218218 */
219219 public function rawQuery ($ query , $ bindParams = null , $ sanitize = true )
220220 {
221+ $ params = array ('' ); // Create the empty 0 index
221222 $ this ->_query = $ query ;
222223 if ($ sanitize )
223224 $ this ->_query = filter_var ($ query , FILTER_SANITIZE_STRING ,
224225 FILTER_FLAG_NO_ENCODE_QUOTES );
225226 $ stmt = $ this ->_prepareQuery ();
226227
227228 if (is_array ($ bindParams ) === true ) {
228- $ params = array ('' ); // Create the empty 0 index
229229 foreach ($ bindParams as $ prop => $ val ) {
230230 $ params [0 ] .= $ this ->_determineType ($ val );
231231 array_push ($ params , $ bindParams [$ prop ]);
@@ -237,6 +237,7 @@ public function rawQuery ($query, $bindParams = null, $sanitize = true)
237237
238238 $ stmt ->execute ();
239239 $ this ->_stmtError = $ stmt ->error ;
240+ $ this ->_lastQuery = $ this ->replacePlaceHolders ($ this ->_query , $ params );
240241 $ this ->reset ();
241242
242243 return $ this ->_dynamicBindResults ($ stmt );
@@ -719,6 +720,9 @@ protected function _dynamicBindResults(mysqli_stmt $stmt)
719720 $ this ->count ++;
720721 array_push ($ results , $ x );
721722 }
723+ // stored procedures sometimes can return more then 1 resultset
724+ if ($ this ->_mysqli ->more_results ())
725+ $ this ->_mysqli ->next_result ();
722726
723727 if ($ this ->fetchTotalCount === true ) {
724728 $ this ->fetchTotalCount = false ;
0 commit comments