Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. <?php
  2. $username = "username";
  3. $password = "password";
  4. $host = "localhost";
  5. $db = $username;
  6. $connection = mysqli_connect($host, $username, $password, $db);
  7.  
  8. if(isset($_POST["PSol"]))
  9. {
  10. $sql = "UPDATE table SET column = '..' WHERE id = 1";
  11.  
  12. if ($connection->query($sql) === TRUE) {
  13. echo "Record updated successfully";
  14.  
  15. mysqli_close($connection);
  16. echo "<p>Disconnected from server: ".$host."</p>";
  17. } else {
  18. echo "Error updating record: " . $connection->error;
  19.  
  20. mysqli_close($connection);
  21. echo "<p>Disconnected from server: ".$host."</p>";
  22. }
  23. }
  24. }
  25. ?>
  26. <form method = "POST" name = "PSolCanvas" class = "PSolCanvas">
  27. <input type = "button" name = "PSol" class = "PSol" value = "P"/>
  28. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement