value; } } else { $user_schools[] = $metadata->value; } // Using the method from the api.php $schools = getSchoolsFromIDs(implode(",", $user_schools)); foreach ($schools as $sc) { $res[] = array($sc->school_id, $sc->school_name); } } else if (get_input('action') == 'single_school') { $school_id = get_input("school_id"); $school = get_data("SELECT * FROM {$CONFIG->dbprefix}koolielu_schools WHERE school_id = {$school_id}"); if ($school) { $school = $school[0]; $res = array($school->school_name, $school->address, $school->postalindex, $school->city); } } else { // Pretty much do nothing } echo json_encode($res); ?>