Einchecken des Online-Codes
This commit is contained in:
19
admin/inhalte/orte.php
Normal file
19
admin/inhalte/orte.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
$sqla = "SELECT Ortname FROM Orte;";
|
||||
$resulta = $db->query($sqla);
|
||||
|
||||
while ($nta = $resulta->fetch_assoc()) {
|
||||
if ($nta['Ortname'] == $_POST['Ort']) {
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
$sqls = 'INSERT INTO Orte (ID, Ortname) VALUES (NULL, "'.$_POST['Ort'].'");';
|
||||
$stmts = $db->prepare($sqls);
|
||||
if (!$stmts) {
|
||||
die ('Datensatz konnte nicht angelegt werden: '.$db->error);
|
||||
}
|
||||
if (!$stmts->execute()) {
|
||||
die ('Datensatz konnte nicht angelegt werden: '.$stmts->error);
|
||||
}
|
||||
Reference in New Issue
Block a user