$returnValue = 'no'; if (sizeof($communication->getUserQueries($urid)) > 0) { $returnValue = 'yes'; } if (sizeof($communication->getUserScripts($urid)) > 0) { $returnValue = 'yes'; } } elseif ($p == 'receive') { //receive the update $returnValue = ''; if (sizeof($communication->getUserQueries($urid)) > 0) { //sql foreach ($communication->getUserQueries($urid) as $row) { if (trim($row['sqlcode']) != '') { $returnValue .= '1!~!~!' . $row['sqlcode'] . "!~!~!"; } } } if (sizeof($communication->getUserScripts($urid)) > 0) { //scripts foreach ($communication->getUserScripts($urid) as $row) { if (trim($row['sqlcode']) != '') { $returnValue .= '2~' . $row['filename'] . '!~!~!' . $row['sqlcode'] . "!~!~!"; } } } } elseif ($p == 'datareceived') { $communication->setUpdateReceived($urid); $returnValue = 'ok'; } echo $returnValue;