$stmt =$db->prepare("INSERT INTO postviews (post_id,IPaddress) VALUES (:post_id,:IPaddress)");
$stmt =$db->prepare("INSERT INTO postviews (post_id,IPaddress) VALUES (:post_id,:IPaddress) ON DUPLICATE KEY UPDATE counter = counter + 1");
post_id
IPaddress
UPDATE table
INSERT INTO table
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)