$query = $db->query("SELECT yesterday_clicks, today_clicks FROM surf WHERE id = 1 ")->fetch(PDO::FETCH_ASSOC);
if( $query ){
$yesterday_clicks = $query['today_clicks'];
$today_clicks = 0;
$update= $db->prepare("UPDATE surf SET
yesterday_clicks= :yesterday,
today_clicks=:today
where id=1");
$update = $query->execute(array(
"yesterday" => $yesterday_clicks,
"today" => $today_clicks
));
if ( $update ){
echo "Tamamlandı !";
}
}
via: Tayfun Erbilen