eCommerce construction > General Discussion

Added order date


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 ..

What page do you want to modify?

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:

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:
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.


[0] Message Index

Go to full version
Powered by SMFPacks Social Login Mod