<?php
    require_once("../../php/db_utils.php");
    
    try {
        // Connect to the database
        $database = databaseConnect();
        
        // Incoming data
        $tag = $_POST["tag"];
        $username = $_POST["username"];
        
        // Declare query
        $query = "DELETE FROM tags WHERE tag = '" . $tag . "' AND username = '" . $username . "';";
        
        // Run query
        databaseQueryNoReturn($database, $query);
        
        // Close the connection to the database
        databaseClose($database);
    }
    catch(Exception $e) {
        $errorMsg = $e->getMessage();
        print_r($errorMsg);
    }
?>