Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.

Uncaught Error: Call to a member function rowCount()

Version 8.00.23
When I delete a thread through the moderator options "delete thread" this will fail.
(https://tele2.gebruikers.eu/forum/options.php?forum_id=33&thread_id=3104)

When I delete a thread by selecting a checkbox in viewforum it works ok!
(https://tele2.gebruikers.eu/forum/viewforum.php?forum_id=33)

The error message shown is:
Uncaught Error: Call to a member function rowCount() on null in /*/includes/db_handlers/pdo_functions_include.php:211\nStack trace:\n#0 /*/forum/options.php(115): db_affrows()\n#1 {main}\n thrown in /*/includes/db_handlers/pdo_functions_include.php on line 211', referer: */forum/options.php?forum_id=59&thread_id=2180

In options.php I find this line $del_posts = db_affrows(); which refers to pdo_functions_include.php
In pdo_functions_include.php I find:
CodeDownload  
function db_affrows() {
 global $pdo;

 if ($pdo !== FALSE) {
 return $pdo->rowCount();
 }

 return NULL;
}



But I can't figure out what is wrong with it. The function db_affrows() can't be found elsewhere but in options.php
So I looked at the (working) code for deleting threads in viewforum.php.
This is different from options.php but does not use function db_affrows()

So can any one see what is wrong with function db_affrows()?
Or could any one rewrite the code for deleting threads in options.php by taking a look at the similar code in viewforum.php?

I compared the files with the newer 8.00.30, but the code is the same.
Thanks. I'll let you know if that fixed it.

Edit: Couldn't resist to try the modified code. Result: works!

Is it safe to remove function db_affrows() from pdo_functions_include.php?
Great!
Yes, only adminnistration/forums_prune.php uses it atm. I will update for next patch.
Edit: Updated.
Thread Information
Author
Replies
4 posts
Views
268 times
Last Post
Last updated on 6 months ago
You can view all discussion threads in this forum.
You cannot set up a bounty in this discussion thread.
You can start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
You cannot up or down-vote on the post in this discussion thread.
Users who participated in discussion: Falk, Wanabo