Advertisement
syntx1000

Web Unity

May 8th, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. <?php
  2.  
  3. $servername = "localhost";
  4. $server_username = "id8115757_roots";
  5. $server_password = "12345";
  6. $dbName = "id8115757_dyslexiadbs";
  7.  
  8.  
  9. $name = $_POST["namePost"];
  10. $math= $_POST["mathPost"];
  11. $reading = $_POST["readingPost"];
  12. $writing = $_POST["writingPost"];
  13.  
  14.  
  15. $conn = new mysqli($servername, $server_username, $server_password, $dbName);
  16.  
  17. if(!$conn){
  18. die("Connection Failed. ". mysqli_connect_error());
  19. }
  20. else
  21. {
  22. $sql = "INSERT INTO test (name, math, reading, writing)
  23. VALUES ('".$name."','".$math."','".$reading."','".$writing."')";
  24. $result = mysqli_query($conn ,$sql);
  25.  
  26. if(!result) echo "there was an error";
  27. else echo "LOG IN";
  28. }
  29.  
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement