dbcalmada

DB Insert

May 6th, 2016
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.44 KB | None | 0 0
  1. <?php
  2.  
  3. $link = mysqli_connect("127.0.0.1", "dbadmin", "p9zzW@", "contacts");
  4.  
  5. if (!$link) {
  6.    die("Error! Can't connect to the database!");
  7. } else {
  8.    $query = "INSERT INTO contacts VALUES (11, 'Efren', 'Sumalabe',    
  9.   '71 Marquinton St., Fortune', 'Pasay City', '', '', '', '')";
  10.    $result = mysqli_query($link,$query);
  11.    if ($result) {
  12.       die("Success!");
  13.    } else {
  14.       die("Error!");
  15.    }
  16. }
  17.  
  18. mysqli_close($link);
  19. ?>
Add Comment
Please, Sign In to add comment