Cheese
member
Posts: 1
|
I'm trying to capture my customers info via the payment variable information url using php to insert values into my db. I"m having a few issues with my data types for my fields in my table, specifically "payment_date" and "mc_gross". I'm using mysql and currently my field types are "datetime" for payment_date and "decimal(6,0)" for "mc_gross".
I've had mixed results with date. Here are two recent entries using the field type i mentioned above:
0000-00-00 00:00:00
2006-09-16 00:00:00
These were both sold and entered into the table sometime early this morning.....
My mc_gross field is showing up as just the first digit of a price like $x.xx. So one value has been 4 and the other has been 9.....and they should have been 4.99 and 9.99 (or something similar).
Anyone know which data types i should be using for these fields in my table to accurately capture the data?
# POSTED ON: November 4, 2007 @ 10:52 GMT -7
|
E-junkieChef
E-Junkie Crew
Posts: 780
|
payment_date is a string and you will have to convert it to YYYY-MM-DD HH:MM:SS format before you can enter it in a table. to do that in php, use this code
<?php
$payment_date=date("Y-m-d H:i:s",strtotime($payment_date));
?>
mc_gross should be decimal (9,2)
# POSTED ON: November 4, 2007 @ 12:08 GMT -7
|