I have the following code :
echo $gibs=Db::getResult($sql,$query);
print_r($gibs);
count($gibs);
if($gibid!='' && count($gibs)<=0){
$gibs=array(
'gibid'=>$gibid,
'userid'=>$userid,
'isowner'=>false
);
}
Resulting output :
ArrayArray ( )
why count($gibs) not returning any thing.
thats why the flow don’t going in if condition.
To see the output of
count($gibs);you should assign the function to some variable, or print it:In your case, it’s value will be
0, because$gibsarray is empty (it is seen out of theprint_routput).Ifcondition might not work, because$gibid == 0