nextId
This commit is contained in:
		@@ -36,6 +36,14 @@ class BenutzerController
 | 
				
			|||||||
        return json_encode($data);
 | 
					        return json_encode($data);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public function nextId()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        $result = $this->db->nextId();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return json_encode($result);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
?>
 | 
					?>
 | 
				
			||||||
@@ -94,6 +94,26 @@ class BenutzerModel extends Database
 | 
				
			|||||||
        return $result;
 | 
					        return $result;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public function nextId()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        $pdo = $this->linkDB();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        $sql = "SELECT `auto_increment` FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 'Benutzerkonto'; ";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        try {
 | 
				
			||||||
 | 
					            $stmt = $pdo->prepare($sql);
 | 
				
			||||||
 | 
					            $stmt->execute();
 | 
				
			||||||
 | 
					        } catch (\PDOException $e) {
 | 
				
			||||||
 | 
					            return false;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        $result = $stmt->fetchALL(\PDO::FETCH_ASSOC);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return $result;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user