the thing is when i left text area blank, i want it to delete that entry
I have a table in which i want to update primary key (RegNo) and (Name)
Table students
(Primary Key) (Foreign Key)
RegNo Name Passwd ProjectID
f12345 Ali 345 1
f12346 Chris 346 1
f12347 Ameer 347 1
I am tried few ways,
$names = [
['reg'=> $_POST['s1_id'], 'name'=> $_POST['s1_name']],
['reg'=> $_POST['s2_id'], 'name'=> $_POST['s2_name']],
['reg'=> $_POST['s3_id'], 'name'=> $_POST['s3_name']]
];
$query="update students SET Name=:Name WHERE RegNo=:reg And
ProjectID='$id'";
foreach ( $names as $name)
{
try
{
$stmt = $conn->prepare( $query );
$stmt->bindParam(':Name', $name['name']);
$stmt->bindParam(':reg', $name['reg']);
$result = $stmt->execute();
$msg = "Record updated";
//header("location:adminhome.php");
}
catch(PDOException $ex)
{
$msg = $ex -> getMessage();
}
}
Through this way i was able to update Name column only. How i can update both RegNo and Name. I am new to back-end Programming. Don't know how to achieve this.

SETtingName=:Name