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. Quote Link to comment https://forums.phpfreaks.com/topic/286113-update-profile-views/ Share on other sites More sharing options...
Solution JackCode Posted February 11, 2014 Author Solution Share Posted February 11, 2014 Fixed. Quote Link to comment https://forums.phpfreaks.com/topic/286113-update-profile-views/#findComment-1468494 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.