teamgbz123

submitphp

Feb 4th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. <?php
  2. $servername="localhost";
  3. $username="id399211_teamgbz";
  4. $password="killerz";
  5. $dbNAme="id399211_test123";
  6. $conn=new mysqli($servername,$username,$password,$dbNAme);
  7. $name=$_POST["name"];
  8. $score=$_POST["score"];
  9. if(!$conn){
  10. echo "Done";
  11. die("connection faild.".mysqli_connect_error());
  12. }
  13. $sql="insert into table1(name,score) values ('".$name."','".$score."')";
  14. $result=mysqli_query($conn,$sql);
  15. if(!result) echo "There was an error";
  16. else echo "Everything ok";
  17.  
  18. ?>
Add Comment
Please, Sign In to add comment