Is it possible to run a MySQL query using jQuery? I\'m trying to emulate the functionality of voting on SE sites.
The vote counter on SE automatically updates witho
It's just a few lines in your favorite language.
$.post('script.php', { id: 12345 }, function(data) {
// Increment vote count, etc
});
$id = intval($_POST['id']);
mysql_query("UPDATE votes SET num = num + 1 WHERE id = $id");
There are many different ways to accomplish this.