/** * @param Sub_City $sub_city * @return bool * this function adds subcity to the database * if the subcity is added to the database it will return true * else it will return false */ function Add_Sub_City(Sub_City $sub_city) { $Sub_City_Name = $sub_city->getSubCity(); $Sub_City_Name_Amharic = $sub_city->getSubCityAmharic(); $query = "INSERT INTO sub_city (Name,Name_Amharic) VALUES('{$Sub_City_Name}','{$Sub_City_Name_Amharic}')"; $result = mysqli_query($this->getDbc(), $query); if ($result) { return TRUE; } else { return FALSE; } }
function Edit_Sub_City(Sub_City $Sub_City, $Sub_City_ID) { $Name = $Sub_City->getSubCity(); $Name_Amharic = $Sub_City->getSubCityAmharic(); $query = "UPDATE Sub_City set Name='{$Name}',Name_Amharic='{$Name_Amharic}' where ID='{$Sub_City_ID}'"; $result = mysqli_query($this->getDbc(), $query); if ($result) { return TRUE; } else { return FALSE; } }