Gayner Posted September 1, 2009 Share Posted September 1, 2009 $entry['views'] = +1; $DB->query("UPDATE ibf_faq SET views = '{$entry['views']}' where cid = $id"); Each time i refresh it stays at 1.. ? any idea? Quote Link to comment https://forums.phpfreaks.com/topic/172674-solved-simple-php-counter-not-working/ Share on other sites More sharing options...
Adam Posted September 1, 2009 Share Posted September 1, 2009 Should be: $entry['views'] += 1; Quote Link to comment https://forums.phpfreaks.com/topic/172674-solved-simple-php-counter-not-working/#findComment-910168 Share on other sites More sharing options...
Mark Baker Posted September 1, 2009 Share Posted September 1, 2009 $DB->query("UPDATE ibf_faq SET views = views+1 where cid = $id"); Quote Link to comment https://forums.phpfreaks.com/topic/172674-solved-simple-php-counter-not-working/#findComment-910169 Share on other sites More sharing options...
Gayner Posted September 1, 2009 Author Share Posted September 1, 2009 $DB->query("UPDATE ibf_faq SET views = views+1 where cid = $id"); thx Quote Link to comment https://forums.phpfreaks.com/topic/172674-solved-simple-php-counter-not-working/#findComment-910175 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.