JackCode Posted February 11, 2014 Share Posted February 11, 2014 Hi, basically I want a dynamic hit counter every time someone views someone else's profile. Here is my code: <?php $req = mysql_query('select hits from users where username="'.$username.'"'); $dn = mysql_fetch_array($req); $update = mysql_query('UPDATE users SET hits = hits + 1 WHERE username="'.$username.'"'); echo "Profile views: ".$dn['hits']; ?> It returns the value in the database but does not update it dynamically unless I change it myself in the database. Link to comment https://forums.phpfreaks.com/topic/286113-update-profile-views/ Share on other sites More sharing options...
JackCode Posted February 11, 2014 Author Share Posted February 11, 2014 Fixed. Link to comment https://forums.phpfreaks.com/topic/286113-update-profile-views/#findComment-1468494 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.