Table data insert : Database Insert : MySQL Database PHP Source Code


PHP Source Code » MySQL Database » Database Insert »

 

Table data insert



<?php
   mysql_connect("mysql153.secureserver.net","navioo","password");
   mysql_select_db("navioo");

      $id = "12";
      $name = "Joe";

      $query = "INSERT INTO Employee SET id='$id', name='$name'";
      $result = mysql_query($query);

      // Display an appropriate message
      if ($result
         echo "<p>Product successfully inserted!</p>";
      else 
         echo "<p>There was a problem inserting the Employee!</p>";

      mysql_close();
?>


           
       



HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo MySQL Database
» Database Insert