From baee827a5559e5ea2948397dcd89b09777c8b48c Mon Sep 17 00:00:00 2001 From: ayamberkakienam <zackhardyz@gmail.com> Date: Sat, 7 Oct 2017 15:52:27 +0700 Subject: [PATCH] Done creating handler to insert order record --- order/order_handler.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/order/order_handler.php b/order/order_handler.php index 04c1720e..6c58d863 100644 --- a/order/order_handler.php +++ b/order/order_handler.php @@ -7,14 +7,18 @@ $dest_city = $_POST['destination']; $score = $_POST['rating']; $comment = $_POST['comment']; - $date = date("Y-m-d") + $date = date_create() -> format("Y-m-d"); $insert_order_query = mysqli_query($con, " - INSERT INTO order (dest_city, pick_city, score, comment, driver_id, cust_id, date) - VALUES ($dest_city, $pick_city, $score, $comment, $driver_id, $cust_id) - ") or die(mysqli_error()); + INSERT INTO `order`(dest_city, pick_city, score, comment, driver_id, cust_id, date) + VALUES ('".$dest_city."', '".$pick_city."', '".$score."', '".$comment."', '".$driver_id."', '".$cust_id."', '".$date."') + ") or die(mysqli_error($con)); - header("Location : order.php") + header("Location : order.php"); + if ($insert_order_query) { + } else { + echo 'wrong hole'; + } mysqli_close($con); ?> \ No newline at end of file -- GitLab