isValidFor('api')) { die(json_encode(['success' => false])); } $wkSqlQuery = "SELECT DISTINCT" ." `wkParticipo_Users`.* " ." FROM `wkParticipo_Users`" ." JOIN `vormundschaft`" ." ON `wkParticipo_Users`.`id` =`vormundschaft`.`userId`" ." JOIN `wkParticipo_user<=>userAttributes`" ." ON `wkParticipo_user<=>userAttributes`.`userId` = `vormundschaft`.`kidId`" ." WHERE `wkParticipo_user<=>userAttributes`.`attributeId` = 4" ." ORDER BY `wkParticipo_Users`.`id` ASC;"; $wkSqlResponse = dbConnector::query($wkSqlQuery); // Postprocessing // - convert the comma separated list into an array foreach( $wkSqlResponse as &$user){ $user['eMail'] = explode(",", $user['eMail']); foreach( $user['eMail'] as &$email){ $email = trim($email); } } // Sending Response // - setting header header('Content-Type: application/json'); // - sending body payload echo( json_encode($wkSqlResponse) ); // @todo Should not be necessary. But until the problem with the timeout time of the requesting client is solved, this explicit exit() stands! exit(0); ?>