Advertisement
apl-mhd

reg

Sep 11th, 2018
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.85 KB | None | 0 0
  1.  
  2. <?php
  3. /**
  4.  * Created by PhpStorm.
  5.  * User: apelmahmud
  6.  * Date: 02/04/2017
  7.  * Time: 3:24 PM
  8.  */
  9.  
  10.  
  11. $serverName = 'localhost';
  12. $userName = 'root';
  13. $pass = '';
  14. $dbname = 'am';
  15.  
  16. $conn = new  mysqli($serverName,$userName,$pass,$dbname);
  17.  
  18. if($conn->connect_error){
  19.  
  20.     die("aaa");
  21. }
  22.  
  23. $name = $_GET['name'];
  24. $insName = $_GET['insName'];
  25. $address = $_GET['address'];
  26.  
  27.  
  28.  
  29. //$sql = "INSERT INTO info(name) values ( '1' )";
  30.  
  31.  
  32. $sql = "INSERT INTO info(name,inst, add)
  33.  
  34.                             values (' ".$name." ',  ' ".$name." ' , ' ".$address." ') ";
  35.  
  36. /*$sql = "INSERT INTO info(name, inst, add)
  37.  
  38.                              values (' ".$name." ', ' ".$insName."', ' ".$address." ' ) ";*/
  39.  
  40.  
  41. if ($conn->query($sql) == true)
  42.     echo "insert success";
  43.  
  44.     else
  45.         echo "Error: " . $sql . "<br>" . $conn->error;
  46.  
  47.  
  48.  
  49.  
  50.  
  51. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement