Advertisement
Guest User

Untitled

a guest
Mar 11th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. Connection refused in /storage/h2/940/646940/public_html/phpcode.php on line 7
  2. Connection failed: Connection refused
  3.  
  4. <?php
  5. $servername = "xxx.com";
  6. $username = "xxx";
  7. $password = "xxx";
  8. $dbname = "idxxx_demo";
  9. // Create connection
  10. $conn = new mysqli($servername, $username, $password, $dbname);
  11. // Check connection
  12. if ($conn->connect_error) {
  13. die("Connection failed: " . $conn->connect_error);
  14. }
  15. $Wann=$_POST['Wann'];
  16. $Wo = $_POST['Wo'];
  17. $Was = $_POST['Was'];
  18. $Zahl = $_POST['Zahl'];
  19. $sql = "INSERT INTO demotabe (Wann,Wo,Was,Zahl,Option)
  20. VALUES ('{$Wann}','{$Wo}','{$Was}','{$Zahl}','{$Option}')";
  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. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement