24 lines
385 B
PHP
24 lines
385 B
PHP
<?php
|
|
require_once('data.php');
|
|
?>
|
|
|
|
<?php
|
|
|
|
$db = dbVerbindungErzeugen();
|
|
|
|
$id = $_GET["id"];
|
|
$sql = "SELECT likes FROM idee WHERE id = $id";
|
|
$resultat = $db->query($sql);
|
|
$likeCount = $resultat ->fetchColumn();
|
|
$likeCount += 1;
|
|
|
|
|
|
echo ($likeCount);
|
|
|
|
$sql = "UPDATE idee SET likes=? WHERE id=?";
|
|
$stmt = $db->prepare($sql);
|
|
$stmt->execute(array($likeCount, $id));
|
|
|
|
|
|
?>
|