This finally worked:
<?php
for ($x = 0; $x < 131 ;$x++)
{
$ZZ = $_POST["z".$x];
if ($ZZ != '')
{echo $x.' = '.$ZZ.'<br>';
$sql='UPDATE photo01 SET PhotoText = ? WHERE id = ?';
$PhotoText = $ZZ;
$id_equal_to = $x;
/* Prepare statement */
$stmt = $conn->prepare($sql);
if($stmt === false) {
trigger_error('Wrong SQL: ' . $sql . ' Error: ' . $conn->error, E_USER_ERROR);
}
/* Bind parameters. TYpes: s = string, i = integer, d = double, b = blob */
$stmt->bind_param('si',$PhotoText,$id_equal_to);
/* Execute statement */
$stmt->execute();
$stmt->close();
}
}
?>