Thursday, 18 October 2018

php - how to update table row data with unique id?

code:



if(isset($_POST['save']))
{
$comment1 = $_POST['comment2'].",".date('Y-m-d');
$comment2 = $_POST['comment2'];
$id = $_POST['id'];
$query = "update enquires2 set comment1 = '$comment1', comment2 = '$comment2', s_date = '$s_datee' where id='$id'";
$result = mysqli_query($link,$query);

if($result==true)
{
echo "successfull";
}
else
{
echo "error!";
}
}
?>









$sql = "select * from enquires2 ";

$result = mysqli_query($link,$sql);
while ($row = mysqli_fetch_array($result))
{
?>










}
?>
comment1 comment2 Action

'>











enter image description here




In this code I want to update table enquires2 with unique id. In following image you see that table row having save button this is only one row similarly it have multiple row which having save button in each row. Now I want that when I click on save button of particular row only that row data will be update. How can I fix this problem ? Please help.



Thank You

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print ...