Author Topic: Added order date  (Read 466 times)

Offline seanwhun

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Added order date
« on: January 20, 2023, 09:50:12 AM »
Help me how can i insert order date in order.php because i added insert date for order customer and the webpage of order is undefined ..
« Last Edit: January 23, 2023, 01:17:43 AM by seanwhun »

Offline Basara

  • Administrator
  • Hero Member
  • *****
  • Posts: 5520
  • Karma: +269/-2
    • View Profile
Re: Added order date
« Reply #1 on: January 23, 2023, 02:34:14 AM »
Hello.
What page do you want to modify?

Offline georgeplunkit

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
    • Travel Guide Ideas
Re: Added order date
« Reply #2 on: February 17, 2023, 12:16:17 AM »
To insert the order date into the order.php page, you will need to modify the code to include the date in the database query.

Here's an example of how you can do this:

Add a new column in the orders table for the order date. You can use the DATETIME data type to store the date and time of the order.

In the order.php file, add a new variable to store the current date and time. You can use the date() function in PHP to get the current date and time in the format you want. For example:

php
Copy code
$order_date = date('Y-m-d H:i:s');
This will store the current date and time in the $order_date variable in the format YYYY-MM-DD HH:MM:SS.

Update the database query to include the order date in the INSERT INTO statement. For example:
php
Copy code
$sql = "INSERT INTO orders (customer_id, order_date) VALUES ('$customer_id', '$order_date')";
This will insert the customer ID and order date into the orders table when a new order is placed.

Make sure to update any other parts of the code that reference the orders table to include the new order_date column.
Once you have made these changes, you should be able to insert the order date into the database and display it on the order.php page. If you are still experiencing issues with the webpage being undefined, you may need to review your code for errors or consult with a developer to identify and resolve any issues.

 

Powered by SMFPacks Social Login Mod