Delete Methode implementiert, nicht getestet
This commit is contained in:
		@@ -16,5 +16,10 @@
 | 
				
			|||||||
            $result=$this->db->insertEnthaelt($data);
 | 
					            $result=$this->db->insertEnthaelt($data);
 | 
				
			||||||
            return json_encode($result);
 | 
					            return json_encode($result);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public function deleteEnthaelt($id){
 | 
				
			||||||
 | 
					            $result=$this->db->deleteEnthaelt($id);
 | 
				
			||||||
 | 
					            return json_encode($result);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
?>
 | 
					?>
 | 
				
			||||||
@@ -48,5 +48,20 @@
 | 
				
			|||||||
                return false;
 | 
					                return false;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public function deleteEnthaelt($id){
 | 
				
			||||||
 | 
					            $pdo=$this->linkDB();
 | 
				
			||||||
 | 
					            $params = array();
 | 
				
			||||||
 | 
					            $sql = "DELETE FROM Enthaelt WHERE id=:id";
 | 
				
			||||||
 | 
					            $params[":id"] = $id;
 | 
				
			||||||
 | 
					            try{
 | 
				
			||||||
 | 
					                $stmt = $pdo->prepare($sql);
 | 
				
			||||||
 | 
					                $stmt->execute($params);
 | 
				
			||||||
 | 
					                return true;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            catch(\PDOExeption $e){
 | 
				
			||||||
 | 
					                return false;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
?>
 | 
					?>
 | 
				
			||||||
		Reference in New Issue
	
	Block a user