I'm now trying to count a click to get Popular Post Counter from reader, but I get problem with How to count it since previous row has no value or null.
Here's my codes:
<?php
error_reporting(0);
include("conndb.php");
if (isset($_GET['id'])){
$idClick=$_GET['id'];
}
$qryClick = $mydb->prepare("SELECT * FROM ra_articlez WHERE id=:$idClick");
$qryClick->execute();
$varClick = $qryClick->fetchAll();
foreach ($varClick as $echoClick) {
$contID=$echoClick['id'];
$cntentqry=$echoClick['count'];
$imgqry=$echoClick['timestamp'];
$sql="UPDATE ra_articlez SET count=count+1 WHERE id = :idClick";
echo $cntentqry; // can not echo the result
}
?>
Do you have better than it does? please suggest me, thanks.