Quote:
$deletequery = "DELETE FROM like_unlike WHERE type='1' where userid='$userid' and postid='$postid'";
You've got two
WHERE
clauses in your
DELETE
statement. Unless it's a MySql-special, you should only have one:
$deletequery = "DELETE FROM like_unlike WHERE type='1' and userid='$userid' and postid='$postid'";
But you really need to fix the
SQL Injection[
^] vulnerabilities. :)