$re = mysql_query("SELECT * FROM post WHERE id=1",$db);
$a = mysql_fetch_array($re);
$c = $a['counter'];
$counter = $c + 1;
$s = "UPDATE post SET counter='$counter' WHERE id='1'";
mysql_query($s);
$ree = mysql_query("SELECT * FROM post WHERE id=1",$db);
$dd = mysql_fetch_array($ree);
echo $dd[counter];
$sql = "UPDATE post SET counter=counter+1 WHERE id=?";
$pdo->prepare->($sql)->execute([$id]);
$stm = $pdo->prepare("SELECT counter FROM post WHERE id=1");
$stm->execute([$id]);
echo $stm->fetchColumn()