remove-collaborator.php 688 B

12345678910111213141516171819202122232425
  1. <?php
  2. require_once("../../php/db_utils.php");
  3. try {
  4. // Connect to the database
  5. $database = db_connect();
  6. // Incoming data
  7. $canvasId = $_POST["canvas_id"];
  8. $collaborator = $_POST["collaborator"];
  9. // Declare query
  10. $query = 'DELETE FROM collaborators WHERE canvas_id = "' . $canvasId . '" AND collaborator = "' . $collaborator . '";';
  11. // Run query
  12. db_query_no_return($database, $query);
  13. // Close the connection to the database
  14. db_close($database);
  15. }
  16. catch(Exception $e) {
  17. $errorMsg = $e->getMessage();
  18. print_r($errorMsg);
  19. }
  20. ?>