melder/ajax/ajax_rating.php

20 lines
447 B
PHP
Raw Permalink Normal View History

2024-02-16 15:35:01 +01:00
<?php
2024-03-11 12:55:17 +01:00
2024-02-16 15:35:01 +01:00
require_once("../config.php");
$mode = trim($_POST['mode']);
$id = (int)$_POST['id'];
$value = (int)$_POST['value'];
if ($mode=="up") {
$db->exec("UPDATE location SET thumb_ups=thumb_ups+1 WHERE id=".$id);
echo "success";
} elseif ($mode=="down") {
$db->exec("UPDATE location SET thumb_downs=thumb_ups+1 WHERE id=".$id);
echo "success";
} else {
echo "error";
};