In the code {code...} above, $ variables is an empty array with an index of numbers. How can it be bound .. I 'd better explain why I wrote this? Grateful.
If ($ result instanceof mysqli_stmt) {$ result-> store_result (); $ variables = array (); $ data = array (); $ meta = $ result-> result_metadata (); // from here on the while ($ field = $ meta-> fetch_field ()) $ variables [] = & $ data [$ field-> name]; // pass by reference call_user_func_array (array ($ result, 'Bind _ result'), $ variables ); $ I = 0; while ($ result-> fetch () {$ array [$ I] = array (); foreach ($ data as $ k => $ v) $ array [$ I] [$ k] = $ v; $ I ++ ;}}
In the code above, $ variables is an empty array with an index of numbers. How can it be bound .. I 'd better explain why I wrote this? Grateful.
Reply content:
If ($ result instanceof mysqli_stmt) {$ result-> store_result (); $ variables = array (); $ data = array (); $ meta = $ result-> result_metadata (); // from here on the while ($ field = $ meta-> fetch_field ()) $ variables [] = & $ data [$ field-> name]; // pass by reference call_user_func_array (array ($ result, 'Bind _ result'), $ variables ); $ I = 0; while ($ result-> fetch () {$ array [$ I] = array (); foreach ($ data as $ k => $ v) $ array [$ I] [$ k] = $ v; $ I ++ ;}}
In the code above, $ variables is an empty array with an index of numbers. How can it be bound .. I 'd better explain why I wrote this? Grateful.