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;
?>
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());