I have a query that is supposed to be inserting data into a MySQL date field.
The incoming data is formatted as MM/DD/YYYY. I run it through this function:
$birthday = date("Y-m-d",strtotime($data[16]));
When I use var_dump to see what it looks like it, return YYYY-MM-DD which is correct. The issue is that when I go to insert it into the field it always returns 0000-00-00. What gives?
The insert code:
INSERT INTO customers (email_address, confirm_email_address,
full_name, phone_number, status,time, company, industry,fax,
alternate_email_address, address, address2, city, state, zip_code,
country, birthdate, repid, salesrep, secId) VALUES('%s','%s','%s','%s','%s',
UNIX_TIMESTAMP(),'%s','1','%s','%s','%s','%s','%s','%s','%s',
'USA','%d','%d','%d','%d')