OK I have a mySQL table that has a few date columns in, it is set up so that there is a create date and a update date. The UpdateTimeStamp column updates automatically using the on update CURRENT_TIMESTAMP Attributes, Its my understanding that you can only use a one timestamp in this special way, and this is fine.
So on the createdate column I need to manually add the date that the record was created its a datetime column.
I have read that you can use the NOW() command for this. However using it in the following brings me a undefined function error. I have tried it as just 'CreateDate' => NOW(), which gives the same error or using 'CreateDate' => set_value('NOW()'), does not produce an error but no value is entered into the database for this column.
I have also tried 'CreateDate' => set_value(date('Y-m-d H:i:s')) which also does not produce an error but no value is entered into the database for this column
So on the createdate column I need to manually add the date that the record was created its a datetime column.
I have read that you can use the NOW() command for this. However using it in the following brings me a undefined function error. I have tried it as just 'CreateDate' => NOW(), which gives the same error or using 'CreateDate' => set_value('NOW()'), does not produce an error but no value is entered into the database for this column.
PHP:
form_data = array(
'ClientID' => set_value('ClientID'),
'ClientReference' => set_value('ClientReference'),
'CreateDate' => set_value(NOW()),
'Gender' => set_value('Gender'),
'MaritalStatus' => set_value('MaritalStatus'),
'ContactNumber' => set_value('ContactNumber'),
'Nationality' => set_value('Nationality'),
'Ethnicity' => set_value('Ethnicity'),
'ClientNotes' => set_value('ClientNotes')
);
I have also tried 'CreateDate' => set_value(date('Y-m-d H:i:s')) which also does not produce an error but no value is entered into the database for this column