php - I want to show the page views in a news site -
i want show page views in news site. that's why there cell name views.
i trying codes
$sql = "update posts set views=views+1 id=17184";
in singlepage.php page. it's not working. use these codes?
some points more detail...
i want increase value of views 1 in every reload/refresh of page singlepost.php
when click on links index.php singlepost.php open detail of link
let's see using codes , how using...
$sql = "update posts set views=views+1 id=17184";
you have '
around field names generate mysql error. suspect looking backtick stop mysql treating reserved words reserved words (ie: if have table called update
, wrap table name in backticks)
most issue lies query. below i've updated you.
$sql = "update `posts` set `views`=`views`+1 `id`=17184";
Comments
Post a Comment