Skip to content
Snippets Groups Projects
Commit eac4d4ff authored by Golnaz Nilieh's avatar Golnaz Nilieh
Browse files

When deleting a bookmark, remove its tags from database.

parent add0a90e
No related branches found
No related tags found
No related merge requests found
......@@ -35,18 +35,33 @@ if( !OC_User::isLoggedIn()){
exit();
}
$params=array(
urldecode($_GET["url"]),
OC_User::getUser()
);
$query = OC_DB::prepare("
DELETE FROM *PREFIX*bookmarks
SELECT id FROM *PREFIX*bookmarks
WHERE url LIKE ?
AND user_id = ?
");
$id = $query->execute($params)->fetchOne();
$query = OC_DB::prepare("
DELETE FROM *PREFIX*bookmarks
WHERE id = $id
");
$params=array(
urldecode($_GET["url"]),
OC_User::getUser()
);
$result = $query->execute($params);
$result = $query->execute();
$query = OC_DB::prepare("
DELETE FROM *PREFIX*bookmarks_tags
WHERE bookmark_id = $id
");
$result = $query->execute();
// var_dump($params);
echo json_encode( array( "status" => "success", "data" => array()));
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment