if($result instanceof mysqli_stmt) { $result->store_result(); $variables = array(); $data = array(); $meta = $result->result_metadata(); // 从这里开始就迷糊 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 above code, $variables is an empty array indexed to numbers ah, how to bind on the: Better explain why you're writing this? Appreciate.
Reply content:
if($result instanceof mysqli_stmt) { $result->store_result(); $variables = array(); $data = array(); $meta = $result->result_metadata(); // 从这里开始就迷糊 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 above code, $variables is an empty array indexed to numbers ah, how to bind on the: Better explain why you're writing this? Appreciate.