Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x
Author Message
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm



Joined: Aug 13, 2009
Posts: 1123

PostPosted: Mon Apr 17, 2023 1:58 am Reply with quote

Warning: count(): Parameter must be an array or an object that implements Countable in /www.bestbuildpc.org/modules/Forums/groupcp.php on line 830//Only happening in php 7.4

Line 830

Code:
$modgroup_pending_count = count($modgroup_pending_list);


I wonder if I can use array like this
Code:


        $modgroup_pending_list = $db->sql_fetchrowset($result);
        //$modgroup_pending_count = count($modgroup_pending_list);
        $modgroup_pending_count = count(array($variable));
        $db->sql_freeresult($result);

[ Only registered users can see links on this board! Get registered or login! ]

The error is gone but I am not sure if we can use the variable like this. Anyone can explain what is the function of count in this line?
 
View user's profile Send private message
neralex
Site Admin



Joined: Aug 22, 2007
Posts: 1774

PostPosted: Mon Apr 17, 2023 2:11 am Reply with quote

From all what I can see as the variable is used later in this file, I would recommend it like this:

php Code:
$modgroup_pending_count = false;

if (is_array($modgroup_pending_list)) {
$modgroup_pending_count = count($modgroup_pending_list);
}

_________________
Github: RavenNuke 
View user's profile Send private message
hicuxunicorniobestbuildpc







PostPosted: Mon Apr 17, 2023 2:28 am Reply with quote

Morning,

That has sense. I was confused about that line. That should be the way. Thanks. I already made the modifications.
 
neralex







PostPosted: Mon Apr 17, 2023 1:41 pm Reply with quote

Added to the repo: [ Only registered users can see links on this board! Get registered or login! ]
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©