0 Replies Latest reply on Aug 29, 2011 8:34 PM by Helpmepleaseb2a

    Updating the table in not successful! Help

    Helpmepleaseb2a

      I want to update a table when clicking on a link that link another page where i insert the new info into textboxes and i use the action to hold the ID of the employee that i want to update his info please help me this code is not working and i donno why!!!!!

       

      <?php
      if (isset($_POST['submit'])) {
        //This makes sure they did not leave any fields blank
      if (!$_POST['Text2'] | !$_POST['Text3'] | !$_POST['Text4'] | !$_POST['Text5']) {
         die('You did not complete all of the required fields');
        }
      $result = mysql_query("SELECT * FROM employeetable") or die(mysql_error());
      echo '1';
      $i=0;
      if($result_ar = mysql_fetch_assoc($result)){
        echo '2';

        while (isset($_GET["action"]) == $result_ar['EmployeeID']) {
         echo '3';
       
            $FN = $_GET["action"];
        $name = $_POST['Text2'];
           $department = $_POST['Text3'];
           $home = $_POST['Text4'];
        $notes = $_POST['Text5'];
         echo '4';
           $Update = mysql_query("UPDATE employeetable SET EmplyeeName = '$name' , SET Department = '$department' , SET HomeADSL ='$home', SET Notes = '$notes'
                               WHERE EmployeeID = '$FN' ");
            
         echo 'Update successfully done!' ;
       
      }
      }
      }
      ?>