I'm trying to insert six records in a table, but when the script runs I get the following
error: 'Fatal error: Cannot pass parameter by reference'.
See the code below for the specific line:
$ySQL = "SELECT ID_USUARIO FROM USUARIOS WHERE EMAIL=?";
$stmt = $oConni->prepare($ySQL) or die($oConni->error);
$stmt->bind_param('s', $datos[8]);
$stmt->execute();
$stmt->store_result();
$stmt->bind_result($idUsuario);
$stmt->fetch();
$stmt->close();
for($i=1;$i<7;$i++){
$vSQL = "INSERT INTO PERMISOS (ID_USUARIO,ID_ACCION,PERMISOS) VALUES(?,?,?)";
$stmt = $oConni->prepare($vSQL) or die($oConni->error);
// ERROR. The following line throws it:
$stmt->bind_param('iis', $idUsuario, $i, 'S');
$stmt->execute();
$stmt->store_result();
$stmt->close();
}