Guest User

producttoevoegen.php

a guest
Apr 4th, 2017
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title></title>
  5. </head>
  6. <body>
  7.  
  8. <?php
  9. $server = "localhost";
  10. $user = "root";
  11. $pass = "";
  12. $dbname = "toolsforever";
  13.  
  14. //Creating connection for mysqli
  15.  
  16. $conn = new mysqli($server, $user, $pass, $dbname);
  17.  
  18. //Checking connection
  19.  
  20. if($conn->connect_error){
  21. die("Connection failed:" . $conn->connect_error);
  22. }
  23.  
  24. $locatiecode3 = mysqli_real_escape_string($conn, $_POST['locatiecode3']);
  25. $productcode3 = mysqli_real_escape_string($conn, $_POST['productcode3']);
  26. $aantal3 = mysqli_real_escape_string($conn, $_POST['aantal3']);
  27.  
  28. $sql = "INSERT INTO voorraad (Locatiecode, Productcode, Aantal)
  29. VALUES ('$locatiecode3' , '$productcode3' , '$aantal3')";
  30.  
  31. //$sql = "INSERT INTO voorraad (Locatiecode, Productcode, Aantal) VALUES ('$locatiecode3', '$productcode3', '$aantal3')";
  32.  
  33. if($conn->query($sql) === TRUE){
  34. echo "Record Added Sucessfully";
  35. }
  36. else
  37. {
  38. echo "Error" . $sql . "<br/>" . $conn->error;
  39. }
  40. $conn->close();
  41. ?>
  42.  
  43. <a href='producten.php'>Klik hier om terug te gaan.</a>
  44.  
  45.  
  46. </body>
  47. </html>
Add Comment
Please, Sign In to add comment