/** * @param Wereda $wereda * @return bool * this function takes wereda object as a parameter to add it to the database * if the wereda is added it will return true * else it will return false */ function Add_Wereda(Wereda $wereda) { $Wereda_Name = $wereda->getWereda(); $Wereda_Name_Amharic = $wereda->getWeredaAmharic(); $query = "INSERT INTO wereda (Name,Name_Amharic) VALUES('{$Wereda_Name}','{$Wereda_Name_Amharic}')"; $result = mysqli_query($this->getDbc(), $query); if ($result) { return TRUE; } else { return FALSE; } }
function Edit_Wereda(Wereda $Wereda, $Wereda_ID) { $Name = $Wereda->getWereda(); $Name_Amharic = $Wereda->getWeredaAmharic(); $query = "UPDATE Wereda set Name='{$Name}',Name_Amharic='{$Name_Amharic}' where ID='{$Wereda_ID}'"; $result = mysqli_query($this->getDbc(), $query); if ($result) { return TRUE; } else { return FALSE; } }