kullanıcı girerken G/A/Y şeklinde girsin istiyorsanız diğer seçeneği uygulamanız lazım
yani form kısmı eski hali ile kalacak veriyi post ettiğiniz sayfada tarihi yeniden düzenleyeceksiniz.
$date = DateTime::createFromFormat('d/m/Y', $_POST['gelenTarih']);
$YeniTarih = $date->format('Y-m-d'); ( ! ) Error: Call to a member function format() on bool in C:wamp64wwwreservationdistsettingsedit-process.php on line
153 ! ) Fatal error: Uncaught Error: Call to a member function format() on bool in C:wamp64wwwreservationdistsettingsedit-process.php on line
153 if (isset($_POST['addreservation'])) {
$date = DateTime::createFromFormat('d/m/Y', $_POST['start_date']);
$start_date = $date->format('Y-m-d');
$ayarekle=$db->prepare("INSERT INTO reservations SET
start_date=:start_date,
fullname=:fullname,
phone=:phone,
mail=:mail,
room=:room,
pax=:pax,
hour=:hour,
notes=:notes,
source=:source,
source_name=:source_name,
reservation_agent=:reservation_agent,
status=1
");
$insert=$ayarekle->execute(array(
'start_date' => $_POST['start_date'],
'fullname' => $_POST['fullname'],
'phone' => $_POST['phone'],
'mail' => $_POST['mail'],
'room' => $_POST['room'],
'pax' => $_POST['pax'],
'hour' => $_POST['hour'],
'notes' => $_POST['notes'],
'source' => $_POST['source'],
'source_name' => $_POST['source_name'],
'reservation_agent' => $_POST['reservation_agent']
));
if ($insert) {
Header("Location:../reservations.php?status=ok");
} else {
Header("Location:../reservations.php?status=no");
}
}
hata verdi hocam