Guest User

Untitled

a guest
Nov 22nd, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. function WritetoDB(){
  2. alert('Reached. No problem getting here.');
  3. $.get("savedata.php");
  4. }
  5.  
  6. <?php
  7. $servername = "localhost";
  8. $username = "root";
  9. $password = "mysql";
  10. $databaseName = "database";
  11. $tableName = "table";
  12.  
  13. $conn = new mysqli($servername, $username, $password);
  14.  
  15. $A = mysqli_real_escape_string($conn, 'this is A');
  16. $B = mysqli_real_escape_string(($conn, 'this is B'));
  17. $C = mysqli_real_escape_string(($conn, 'this is C'));
  18.  
  19. $sql = "INSERT INTO `database`.`table` (columnA,columnB,columnC)
  20. VALUES ('$A', '$B', '$C')";
  21.  
  22. $conn->close();
  23.  
  24. ?>
Add Comment
Please, Sign In to add comment