i am trying to update quary of "email" by associtive array loop through but when i try this there are take only one last value of array and upadat.
here is code...
<?php
include_once('db_connect.php');
$update_array=array();
$update_array=array(
array('Email'=>'richard123@gmail.com'),
array('Email'=>'hennry123@gmail.com'),
array('Email'=>'loster123@gmail.com'),
array('Email'=>'luffy123@gmail.com'),
array('Email'=>'zoro123@gmail.com'));
print_r($update_array)."<br>";
echo "<pre>";
foreach ($update_array as $value ) {
$update_Email=$value['Email'];
$update="UPDATE form SET email='$update_Email' where id";
$result= mysqli_query($conn, $update);
}
if ($result) {
echo "New record Updated successfully";
}
else {
echo "Error:not created ". mysqli_error($conn);
}
mysqli_close($conn);
?>
image of data update,
i tried nasted foreach to featch array value and than passing into upadate but error apper: array ofset on strin in.
help to update all email's data in once and all.