Advertisement
rangga_hrdme

PHP: INSERT

Dec 3rd, 2021
1,616
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.67 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3.  
  4. <head>
  5.     <meta charset="UTF-8">
  6.     <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  8.     <title>Document</title>
  9. </head>
  10.  
  11. <body>
  12.     <?php
  13.     include '..\connect.php';
  14.     $customerID = $_POST['CustomerID'];
  15.     $customerName = $_POST['CustomerName'];
  16.  
  17.     $SQL = "INSERT INTO customer (CustomerID, CustomerName) VALUES ($customerID, $customerName)";
  18.  
  19.     mysqli_query($koneksi, $SQL);
  20.  
  21.     echo "Tambah Data<br>";
  22.     echo "ID: $customerID<br>";
  23.     echo "Name: $customerName";
  24.  
  25.     mysqli_close($koneksi);
  26.  
  27.  
  28.     ?>
  29.  
  30. </body>
  31.  
  32. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement