i need HELP ! please, about this update PDO which works but takes too long to execute (almost 10 seconds)
// the following $_POST receives 365 values from 365 inputs of the form
$k = $_POST['k'];
// here i am updating all 365 values of column1 of my table
$sql = "UPDATE myTable SET column2=: column2 WHERE id=:id";
$stmt = $conn->prepare($sql);
for ($i = 1; $i <= 365; $i++) {
$id[$i] = $i;
$n = $i-1;
$stmt->bindParam(': column2', $k[$n], PDO:ARAM_STR);
$stmt->bindParam(':id', $id[$i], PDO:ARAM_INT);
$stmt->execute();
}
// the following $_POST receives 365 values from 365 inputs of the form
$k = $_POST['k'];
// here i am updating all 365 values of column1 of my table
$sql = "UPDATE myTable SET column2=: column2 WHERE id=:id";
$stmt = $conn->prepare($sql);
for ($i = 1; $i <= 365; $i++) {
$id[$i] = $i;
$n = $i-1;
$stmt->bindParam(': column2', $k[$n], PDO:ARAM_STR);
$stmt->bindParam(':id', $id[$i], PDO:ARAM_INT);
$stmt->execute();
}