Advertisement
Guest User

Untitled

a guest
Oct 31st, 2017
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1.  
  2. <?php
  3.  
  4. header('Content-Type:text/plain');
  5.  
  6. $servername = "";
  7. $username = "";
  8. $password = "";
  9. $dbname = "protoss1";
  10.  
  11. $conn = mysqli_connect($servername, $username, $password, $dbname);
  12. if (!$conn) {
  13. die("Connection failed: " . mysqli_connect_error());
  14. }
  15.  
  16. if(isset($_POST['submit'])){
  17. $name = $_POST['nm'];
  18. $units = $_POST['uni'];
  19. $number = $_POST['num'];
  20. if($name !=''||$num !=''){
  21.  
  22. $sql = INSERT INTO 'build2' (name, units, number) VALUES ('$name', '$units', '$number');
  23.  
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement