Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6554273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:40:49+00:00 2026-05-25T12:40:49+00:00

the date in the Database has a field of time which you can insert

  • 0

the date in the Database has a field of time which you can insert a date and a time but why is it that it is not being stored all I get is 0’s when I check the database, but the other datas are being stored

here’s my code

<?php 

session_start(); 
include("Connection.php");
    if (isset($_POST['submit']))  
    $name = $_POST['customerName'];


    $mysqldate = date( 'Y-m-d H:i:s' );
    $phpdate = strtotime( $mysqldate );

    mysql_query("INSERT INTO  `starbucks`.`orders` (
`ID` ,
`NAME` ,
`TOTAL_PRICE` ,
`TOTAL_ITEMS` ,
`TIME`
)
VALUES (
'' ,  '$name',  '', '','$phpdate')")  or die(mysql_error());

    $_SESSION['user'] = $name; 
    ?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T12:40:49+00:00Added an answer on May 25, 2026 at 12:40 pm

    use your $mysqldate instead of $phpdate

    mysql_query(“INSERT INTO starbucks.orders (
    ID ,
    NAME ,
    TOTAL_PRICE ,
    TOTAL_ITEMS ,
    TIME
    )
    VALUES (
    ” , ‘$name’, ”, ”,’$mysqldate’)”) or die(mysql_error());

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm dealing with a legacy database that has date and time fields as char(8)
My MySQL database has date of birth stored in the format yyyy-mm-dd, how do
I'm using a database that has a weird date format. I wrote a UserType
I have a table in an Oracle Database that has, among others, a DATE
How can i get the date from database and load it onto the UIDatePicker?
I have Database with date field. I see the time like: 1900-01-01 13:38:00.000 How
I have an UPDATE sql command that modifies a Date/Time field in a particular
Hi all I have an appointments table that has among other fields a DATE
In the database, there are some field is TimeStamp and some are Date, which
I have a custom UserType which stores a date/time value in a TIMESTAMP field

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.