Not sure what is causing this, but I have two ints, like and dislike.
They’re updated by the mysql query:
if ($like == "like"){
mysql_query("UPDATE updates set like = like + 1 WHERE id='$id'");
echo $like;
} else if ($like == "dislike") {
mysql_query("UPDATE updates set dislike = dislike + 1 WHERE id = '$id'");
echo $like;
}
The echo comes out, but, the actual query does not update the value. I’m baffled as to why this happens. Any reason as to why this happens? Thanks, Chris
Maybe because
likeis a reserved word in most SQL dialects. You may need to put thelikein double quotes.Refer to this list of reserved words for MySQL:
http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html