I had a script working to insert a record in to my orders table. The date field was varchar(18) and used a defined time() function to insert into that field.
I then realized I couldn't format the date and time the way I wanted like that, so I would like to insert the current time into the date field as DATETIME.
I changed the datatype for the date field from varchar(18) to DATETIME.
I also changed the function defining what was being input into the date field using:
$order_date= date("Y-m-d H:i:s");
mysql_query("REPLACE INTO orders (username,id,ip,date,method,cart,discount,subtotal,shipping,tax,total,shipping_zone,inv_name,inv_company,inv_addr1,inv_addr2,inv_state,inv_zip,inv_country,del_name,del_addr1,del_addr2,del_state,del_zip,del_country,tel,fax,email,message)
VALUES ('$username',$id,'$ip','$order_date','$method','$cart','$discount','$subtotal','$shipping','$tax','$total',$shipping_zone,'$inv_name','$inv_company','$inv_addr1','$inv_addr2','$inv_state','$inv_zip','$inv_country','$del_name','$del_addr1','$del_addr2','$del_state','$del_zip','$del_country','$tel','$fax','$email','$message')");
Now, orders are not being inserted into the table at all - can someone tell me where I went wrong? It did work before, so I am thinking it has to do with the datetime datatype or the way I'm defining $order_date.
Thanks.