channelGroupClientList() Problem

pwn3r

Member
Jan 1, 2018
143
63
64
I'm making a script for my Control Panel which checks all the channels to see which one you got channel admin on it, but whenever I add this function in my code I get database empty result set error
This is a part of my code:
PHP:
$dbid = $client->client_database_id;
$cogid = 21; // Channel Admin Group ID

$cogrouplist = $ts3->channelGroupClientList($cogid,null,$dbid); // Something is wrong here

if( count($cogrouplist) > 0 ) $haveChannel = TRUE; else $haveChannel = FALSE;
 
Last edited:

kalle

high minded
Contributor
Oct 28, 2015
411
253
178
Try to var_dump all of variables and check their values and types.
 

EscuderoKevin

Well-Known Member
Jul 2, 2015
380
181
130
I'm making a script for my Control Panel which checks all the channels to see which one you got channel admin on it, but whenever I add this function in my code I get database empty result set error
This is a part of my code:
PHP:
$dbid = $client->client_database_id;
$cogid = 21; // Channel Admin Group ID

$cogrouplist = $ts3->channelGroupClientList($cogid,null,$dbid); // Something is wrong here

if( count($cogrouplist) > 0 ) $haveChannel = TRUE; else $haveChannel = FALSE;


// After that, I was gonna use $haveChannel to check whether the client already owns a channel

A little help, please? :( @Alligatoras @TheBeastMC @Kieran @Kleberstoff

use echo for print errors....

echo $dbid;
, check its ok.

Then print_r($cogrouplist);

use die(); for stop script there.


if u gonna make "user Channel control" you need use SQL for save Channels ID and UNIQUE ID. The work with that.
 

pwn3r

Member
Jan 1, 2018
143
63
64
Try to var_dump all of variables and check their values and types.
Lemme explain:
When I have an admin channel group over a channel the script works perfect.
But when I don't I just get database empty result set error

I tried to var_dump all the variables and they are all fine, like when I do var_dump($cogrouplist) while having a channel group I get this:
Code:
array(1) { [0]=> array(3) { ["cid"]=> int(277) ["cldbid"]=> int(7451) ["cgid"]=> int(19) } }
but when I do not own a channel I just get the same error again: database empty result set
 

EscuderoKevin

Well-Known Member
Jul 2, 2015
380
181
130
i thin u need do foreach with channelList and then check if ServerGroup of client its Channel Admin.
 

pwn3r

Member
Jan 1, 2018
143
63
64
EDIT: I solved this by catching the error and checking if its code equals 1281, then it will create the channel for the user.
 
Last edited:
Top