Advertisement
Guest User

Serx

a guest
Aug 15th, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. <?php
  2. header('Content-Type: text/html; charset=utf-8');
  3.  
  4. $empresa = 'TÉCNICOS GEOLOGÍA, PETRÓLEO, CANCIÓN';
  5.  
  6. $servername = "localhost";
  7. $username = "root";
  8. $password = "";
  9. $dbname = "papa";
  10.  
  11. // Create connection
  12. $conn = new mysqli($servername, $username, $password, $dbname);
  13. // Check connection
  14. if ($conn->connect_error) {
  15. die("Connection failed: " . $conn->connect_error);
  16. }
  17.  
  18. $sql = "INSERT INTO empresas (empresa)
  19. VALUES ('$empresa')";
  20.  
  21. if ($conn->query($sql) === TRUE) {
  22. echo "New record created successfully";
  23. } else {
  24. echo "Error: " . $sql . "<br>" . $conn->error;
  25. }
  26. $conn->close();
  27. sleep(0);
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement