Advertisement
Donaldini

jqGrid edit.php

Jun 7th, 2011
580
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.68 KB | None | 0 0
  1. <?php  
  2.    
  3.     // Get information from entry
  4.     $name = $_POST['name'];             //id field from POST above
  5.     $description = $_POST['description'];   //expiration field from POST above
  6.  
  7.     // connect to the MySQL database server
  8.     $dbhost = 'localhost';
  9.     $dbuser = 'root';
  10.     $dbpassword = 'root';
  11.     $database = 'stage.sanatorium';
  12.    
  13.     $db = mysql_connect($dbhost, $dbuser, $dbpassword) or die("Connection Error: " . mysql_error());        // connect to the MySQL database server
  14.     mysql_select_db($database) or die("Error connecting to db.");                                           // select the database
  15.          
  16.     $result = mysql_query("INSERT INTO " . $database ."(name, description) VALUES ('$name', '$description')");
  17.  
  18. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement