marker dzeugs
parent
114b98eccd
commit
87cee6c471
|
@ -1,3 +1,9 @@
|
|||
<?php
|
||||
require_once('system/data.php');
|
||||
|
||||
dbVerbindungErzeugen()
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
|
@ -7,7 +13,6 @@
|
|||
<title>SPINN MIT!</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Spinn mit!</h1>
|
||||
|
||||
<h1>Spinn mit!!!!</h1>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
require_once('data.php');
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
$db = dbVerbindungErzeugen();
|
||||
$sql = "SELECT idee.koordiatenLat, idee.koordiatenLng, idee.likes, idee.id FROM idee;";
|
||||
$resultat = $db->query($sql);
|
||||
$resultatArray = $resultat ->fetchAll();
|
||||
echo json_encode($resultatArray);
|
||||
?>
|
|
@ -26,35 +26,4 @@ function dbVerbindungErzeugen(){
|
|||
}
|
||||
return $db;
|
||||
}
|
||||
|
||||
// Frucht in die DB schreiben
|
||||
function alle_fruechte(){
|
||||
$db = dbVerbindungErzeugen();
|
||||
$sql = "SELECT * FROM Fruchtschale;";
|
||||
$resultat = $db->query($sql);
|
||||
return $resultat->fetchAll();
|
||||
}
|
||||
|
||||
// Frucht in die DB schreiben
|
||||
function fruchtSpeichern($name_de, $name_en){
|
||||
$db = dbVerbindungErzeugen();
|
||||
$sql = "INSERT INTO Fruchtschale (frucht_de, frucht_en) VALUES (?, ?);";
|
||||
$stmt = $db->prepare($sql);
|
||||
return $stmt->execute(array($name_de, $name_en));
|
||||
}
|
||||
|
||||
// eine Frucht auswählen
|
||||
function eine_frucht($id){
|
||||
$db = dbVerbindungErzeugen();
|
||||
$sql = "SELECT * FROM Fruchtschale WHERE id = $id;";
|
||||
$resultat = $db->query($sql);
|
||||
return $resultat->fetch();
|
||||
}
|
||||
|
||||
// Frucht endgültig löschen
|
||||
function fruchtEssen($id){
|
||||
$db = dbVerbindungErzeugen();
|
||||
$sql = "DELETE FROM Fruchtschale WHERE id=?;";
|
||||
$stmt = $db->prepare($sql);
|
||||
return $stmt->execute(array($id));
|
||||
}
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue