Only variables can be passed by reference - php
问题 i am trying this code, but i get this error: Only variables can be passed by reference in xxx script class page { function insert($db, $of, $form, &$arr) { $i = 0; foreach(array_combine($form['value0'], $arr) as $val=>$v){ $sql->prepare("mysqli query here"); $sql->bind_param('ssss', $val, $of, $v[$i][0], $v[$i][1]);//error here $sql->execute(); $i++; } return true; } } what is the reason, and how can be solved ? thanks 回答1: I assume you're using mysqli::bind_param. All arguments except the