post-typing.php 776 B

1234567891011121314151617181920212223242526
  1. <?php
  2. require_once("../../php/db_utils.php");
  3. try {
  4. // Connect to the database
  5. $database = db_connect();
  6. // Incoming data
  7. $typingId = $_POST["typing_id"];
  8. $canvasId = $_POST["canvas_id"];
  9. $username = $_POST["username"];
  10. // Update the typing ID
  11. $query = 'UPDATE collaborators SET typing_id="' . $typingId . '" WHERE canvas_id="' . $canvasId . '" AND collaborator="' . $username . '";';
  12. // Insert new or update old description
  13. db_query_no_return($database, $query);
  14. // Close the connection to the database
  15. db_close($database);
  16. }
  17. catch(Exception $e) {
  18. $errorMsg = $e->getMessage();
  19. print_r($errorMsg);
  20. }
  21. ?>