function getPersonData($isParticipant, $key) { include 'GeneralHelper.php'; include 'DBHelperClass.php'; // create database helper $db = new DBHelperClass(); // get person data $datas = array(); if ($isParticipant) { $datas = $db->getPeople($isParticipant, $key); } else { $datas = $db->getPeople($isParticipant, $key); } // close database helper $db->close(); // check if empty if (empty($datas)) { return array("success" => false); } $data = $datas[0]; return array("success" => true, "data" => $data); }