Update Employee table : Database Update « MySQL Database « PHP






Update Employee table


<?php

   mysql_connect("mysql153.secureserver.net","java2s","password");
   mysql_select_db("java2s");

   $rowID = "0001";
   $name = "Kate";
   $price = "12";

      $query = "UPDATE Employee SET name='$name', price='$price' WHERE ID='$rowID'";
      $result = mysql_query($query);

      if ($result) 
         echo "<p>The developer has been successfully updated.</p>";
      else 
         echo "<p>There was a problem updating the developer.</p>";



?>
           
       








Related examples in the same category

1.Get affected rows for an update
2.Update data record and get the affected rows