I am trying to pass a string to my prepared MySQLi statement, but it gives me an error:
Unable to pass parameter by reference in MySQLi
Here is the relevant code:
$kv = json_encode(array($key => $value)); $stmt->prepare("insert into rules (application_id, ruletype, rule_name, rule_info) values (?, ?, ?, ?);"); $stmt->bind_param('iiss', $application_id, 1, $config_name, $kv);
php mysql mysqli prepared-statement binding
chustar
source share