-2

I am trying to insert a data into a table by updating a value to it with a "text" but it does not update. I do not understand why it is not updating the table field status.

I have run the system but it seems to do no action. The ID of unique row is set to be updated

<?php
session_start();
error_reporting(0);
include('includes/dbconnection.php');
//error_reporting(0);
if (strlen($_SESSION['aid']==0)) {
  header('location:logout.php');
  } else{


if(isset($_POST['submit']))
  {
    $eid=$_SESSION['uid'];
    $eid=$_GET['editid'];

    $status=$_POST['status'];;

     $query=mysqli_query($con, "UPDATE workerdetail SET status='WorkReady' WHERE ID='$eid'");
    if ($query) {
    $msg="Worker is in the WorkReady Pool";
  }
  else
    {
      $msg="Something Went Wrong. Please try again.";
    }
  }
  ?>
<a href="workpool.php?editid=<?php echo $row['ID'];?>">Update Worker to WorkReady</a>   

This for a xampp server trying to update a field when i press the link it will update automatically and will display result in another page. So when i click on the link it should UPDATE the table automatically

1 Answers1

0

your sql is wrong,the right is "UPDATE workerdetail SET status='WorkReady' where ID='$eid'"

Roc.Tong
  • 1
  • 1
  • Sorry i typed it wrong here but it is WHERE however it still does not update the table any help?? – codelearner Aug 22 '19 at 00:50
  • here you write post : if(isset($_POST['submit'])),but your a link is "GET",so program can't excute your update sql – Roc.Tong Aug 23 '19 at 01:06