function addSubCity() { $sub_city = new SubCity(); $sub_city->setValues($_REQUEST); if ($sub_city->newSubCity()) { $session = new Sessions(); $session->setLastSubCityId(mysql_insert_id()); Common::jsonSuccess("Sub City Added Successfully!"); } else { Common::jsonError("Error"); } }