Mavrik347 Posted August 13, 2010 Share Posted August 13, 2010 Parse error: syntax error, unexpected T_STRING in /home/****/public_html/ts3O/cron.php on line 61 Hi guys, first time here, hoping I could get some help on something. Having a bit of a hard time :/ Here is the area of code. try { $ts = TeamSpeak3::factory("serverquery://".$c->tsname.":".$c->tspass."@".$c->tshost.":".$c->tsport."/"); $virt = $ts->serverGetByPort($c->tscport); if ($c->usesta == true) { $virt->serverGroupClientDel($c->stagroup,$cid); } else { $virt->clientdbdelete cldbid=($cid); //LINE 61 } } Below is the version used before... The problem with this however is it's the wrong command. The command (output) I need is "clientdbdelete cldbid=$cid" e.g. "clientdbdelete cldbid=49". But the old line 61 that doesn't generate an error's output is "serverGroupClientDel 2,49" try { $ts = TeamSpeak3::factory("serverquery://".$c->tsname.":".$c->tspass."@".$c->tshost.":".$c->tsport."/"); $virt = $ts->serverGetByPort($c->tscport); if ($c->usesta == true) { $virt->serverGroupClientDel($c->stagroup,$cid); } else { $virt->serverGroupClientDel($c->group,$cid); //LINE 61 } } Quote Link to comment https://forums.phpfreaks.com/topic/210604-parse-error-syntax-error-unexpected-t_string/ Share on other sites More sharing options...
JasonLewis Posted August 13, 2010 Share Posted August 13, 2010 It's because of the space between the method name. Is clientdbdelete a method? Quote Link to comment https://forums.phpfreaks.com/topic/210604-parse-error-syntax-error-unexpected-t_string/#findComment-1098706 Share on other sites More sharing options...
Mavrik347 Posted August 13, 2010 Author Share Posted August 13, 2010 It's a Teamspeak 3 query to delete registrations. Edit: What if I used $clientdbdelete = "clientdbdelete cldbid="; $virt->$clientdbdelete($cid); Or would that just generate the same error? Quote Link to comment https://forums.phpfreaks.com/topic/210604-parse-error-syntax-error-unexpected-t_string/#findComment-1098707 Share on other sites More sharing options...
trq Posted August 13, 2010 Share Posted August 13, 2010 the cldbid part isn't valid syntax. Quote Link to comment https://forums.phpfreaks.com/topic/210604-parse-error-syntax-error-unexpected-t_string/#findComment-1098713 Share on other sites More sharing options...
Mavrik347 Posted August 13, 2010 Author Share Posted August 13, 2010 It's a Teamspeak 3 query to delete registrations. Edit: What if I used $clientdbdelete = "clientdbdelete cldbid="; $virt->$clientdbdelete($cid); Or would that just generate the same error? That stopped the error, but how can i be sure the output is what I want? Quote Link to comment https://forums.phpfreaks.com/topic/210604-parse-error-syntax-error-unexpected-t_string/#findComment-1098717 Share on other sites More sharing options...
btherl Posted August 13, 2010 Share Posted August 13, 2010 clientdbdelete may be a teamspeak 3 command, but it's not a php method name. You'll need to find which php method corresponds to it. For example, it might be something like $virt->ClientDbDelete($cid). Alternatively, if the teamspeak3 object lets you send raw commands you could try it like that too. Quote Link to comment https://forums.phpfreaks.com/topic/210604-parse-error-syntax-error-unexpected-t_string/#findComment-1098718 Share on other sites More sharing options...
trq Posted August 13, 2010 Share Posted August 13, 2010 That is still invalid syntax. Methods cannot have spaces in there names. Quote Link to comment https://forums.phpfreaks.com/topic/210604-parse-error-syntax-error-unexpected-t_string/#findComment-1098719 Share on other sites More sharing options...
Mavrik347 Posted August 13, 2010 Author Share Posted August 13, 2010 clientdbdelete may be a teamspeak 3 command, but it's not a php method name. You'll need to find which php method corresponds to it. For example, it might be something like $virt->ClientDbDelete($cid). Alternatively, if the teamspeak3 object lets you send raw commands you could try it like that too. Found it! clientDeleteDb Only now I get "TS interface error: invalid parameter count". But I guess that's a question for the teamspeak forums. Thanks so much for the help. http://www.sev3rance.com/ts3O/cron.php Quote Link to comment https://forums.phpfreaks.com/topic/210604-parse-error-syntax-error-unexpected-t_string/#findComment-1098727 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.