Jump to content

help with date formatting...


rsammy

Recommended Posts

i am trying to enter the date of registration into a table. i know mysql takes data in YYYY-MM-DD format. I have a field - pat_reg_date set up as timestamp.

i am posting a date(entered on a previous screen) and entering this into the database. this is $datebox and it contains date in the MM/DD/YYYY format.

now in my query ...
INSERT INTO pat_dgraphics (pat_first_name, pat_mid_init, pat_last_name, pat_add, pat_city, pat_state, ..., pat_dob, pat_sex, pat_mar_sta, ...,  pat_reg_date, pat_client_id)
VALUES('$PatientFirstName', '$PatientMiddleInitial','$PatientLastName', '$PatientAddress', '$PatientCity', '$PatientState',..., '$pat_dob_reformat', '$PatientSex', '$PatientMaritalStatus',..., '$datebox', '$client_id')" ;

How do i send in a formatted date here?
Link to comment
https://forums.phpfreaks.com/topic/31271-help-with-date-formatting/
Share on other sites

OK. so how do i send in the date as YYYY-MM-DD format as $datebox now contains date in  MM/DD/YYYY format? Since the formats dont match, my database shows the value for pat_reg_date as 0000-00-00 00:00:00  :(  and does not show any numbers!

help pleeeeeaaaaaase

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.