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? 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; 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"); 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 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
Archived
This topic is now archived and is closed to further replies.