1 (edited by BarryK 2006-06-01 10:27)

Topic: Error: unable to fetch online count

Hi,
I've just installed punbb, it was no trouble at all, and I was able to login as
Administrator.
However, when I click on the "Administation" button, I get the error message
shown in the title.

Anyone got an idea what this bug is and what is causing it?

Re: Error: unable to fetch online count

Enable debug mode and post the full error

Re: Error: unable to fetch online count

I found this thread:
http://punbb.org/forums/viewtopic.php?id=3342

I also use netfirms.com, and it seems the bug is still unresolved.

phpbb works on netfirms.com.

Re: Error: unable to fetch online count

I'm afraid that's a problem with NetFirms and the old version of MySQL they use, not with PunBB wink

5 (edited by kberry79 2006-09-18 21:27)

Re: Error: unable to fetch online count

I recently came across this same problem (I'm using Netfirms as well). I modified the following line and it seems to work:

$result = $db->query('SELECT COUNT(user_id) FROM '.$db->prefix.'online WHERE idle=0');// or error('Unable to fetch online count', __FILE__, __LINE__, $db->error());

I commented out the rest of the line after the select query.

Re: Error: unable to fetch online count

Hurmm... "SELECT COUNT(x) FROM y" is used in a few places in punbb... you might want to grep through the code... I think it's used to find out the next valid topic id, post id,  forum id, user id, etc...

echo "deadram"; echo; fortune;

7 (edited by Smartys 2006-09-18 22:54)

Re: Error: unable to fetch online count

Yes, commenting out the thing that shows the error is likely to remove the error (but it still won't show the data) tongue

Re: Error: unable to fetch online count

Try this instead, where you see the "SEECT COUNT(x) FROM y WHERE x"

$result = $db->query("SELECT x FROM y WHERE x") or error("message");

// Now you should see something along the lines of this:
// $num_online = $db->result($result);
// Change to this:
$num_online = $db->num_rows($result);

Now there is the occational COUNT(x)-1 or SELECT COUNT(x), z FROM y... so yah... this is just a tip to get you in the right direction...

echo "deadram"; echo; fortune;