MyBB Community Forums

Full Version: shutdown query, and mysqli (updating thread views)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
am not sure if this is a bug or no because I can't reproduce in any other forums but my forum.

just since two days the thread's views count had not been updated.

(there is no any changes related to mybb in this period of time)

but once I changed this line in showthread.php
from
$db->shutdown_query("UPDATE ".TABLE_PREFIX."threads SET views=views+1 WHERE tid='{$tid}'");
to
$db->query("UPDATE ".TABLE_PREFIX."threads SET views=views+1 WHERE tid='{$tid}'");
it's back to work again.
so can anyone have any reason why the shutdown query not working for me?
or confirm if this is a bug?

mysql version 5.0.67
php version 5.2.6-2 (mysqli enabled, and enabled in inc/config.php too)
apache 2.2.9
If you have the Favicon plugin, disable it. I don't know why, I never looked into it, but it had an effect.
no I don't have it, but I have a favicon.ico file in my www folder
do you think that may why this problem happen?
Probably not, all I know is that the favicon plugin broke thread views for at least 3 people, including me.

Do you have any plugins that might affect this?? Because the standard showthread.php with the code that you say doesn't work, is ok for me.
here is a list of my plugins
Contact Form (updated for mybb 1.4 by me, and has nothing to do with showthread.php)
Hide Links to Guests
Private Messages Admin
Sitemap Generator (1.4.0RC1)
View Own Threads
Revenue Sharing! (updated by me too)

but this plugins have activated for more then 4 months, and I never had this problem before
Have you tried switching the Use PHP's Shutdown Functionality setting in the AdminCP?
I was think it's for php shutdown not mysql query shutdown.
but anyway, I tried to switch it off, and there is nothing changed,
when I used the standard showthread.php (fresh one) the views count just stop counting.

is there anything special in my php/mysql or apache configuration should be done?
(2008-12-08, 11:27 AM)pepotiger Wrote: [ -> ]I was think it's for php shutdown not mysql query shutdown.
It's actually the same thing in MyBB.

(2008-12-08, 11:27 AM)pepotiger Wrote: [ -> ]but anyway, I tried to switch it off, and there is nothing changed,
when I used the standard showthread.php (fresh one) the views count just stop counting.
Do you have delayed thread views turned on?
How long does your page generation usually take?
(2008-12-08, 12:23 PM)Yumi Wrote: [ -> ]Do you have delayed thread views turned on?
no, it was on until I got this problem, then I turned it off, and it still off now.

(2008-12-08, 12:23 PM)Yumi Wrote: [ -> ]How long does your page generation usually take?

(index.php) SQL Queries: 8 / Global Parsing Time: 0.0319970 / Memory Usage: 5.75 MB
(a thread) SQL Queries: 30 / Global Parsing Time: 0.0315380 / Memory Usage: 5.5 MB
(another thread in a private section) SQL Queries: 25 / Global Parsing Time: 0.0335171 / Memory Usage: 5.25 MB
I hope that what you ask for.