You have a nested call to apiChan()
Shouldn’t if(apichan() == FALSE){ be using $mydata
This just looks like a convoluted way to do this from a PHP programming side.
$noinlive = “UPDATE user_data SET inlive = 0 WHERE inlive = 1”;
this sets everyone to not live if live rather than just the user from $myData