Skip to content

Commit

Permalink
Fixed start date in wrong format
Browse files Browse the repository at this point in the history
  • Loading branch information
KleinDevDE authored Feb 14, 2023
1 parent 17cbc71 commit dfdb6ca
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions html/upload/upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@
$pdo = new PDO('mysql:host=localhost;dbname=usb', $user, $pass);
if ($filename == "Speiseplan") {
$date = DateTime::createFromFormat($format = 'Y-m-d', $_POST['start']);
if (!$date) {
$date = DateTime::createFromFormat($format = 'd.m.Y', $_POST['start']);
}
$colums = array('B', 'C', 'D', 'E', 'F');
$errors = array();
$statement = $pdo->prepare("INSERT INTO mensa (Datum, Mittagessen, Vegetarisch, Nachtisch, Abend)
Expand Down

0 comments on commit dfdb6ca

Please sign in to comment.