How can i save date array to database?
the code belove creates a form for date
$form['date_time'] = array(
'#title' => t('Date'),
'#type' => 'date',
'#description' => t('Please enter the date.'),
);
User then selects the month,day,year.
How can i convert it so that i can save it to database?
function repman_form_submit($form, &$form_state){
drupal_set_message($form_state['values']['date_time']);
I am just using the drupal_set_message to view the output. And i get array.
UPDATE:
Done it using this
'date_month'=> $form_state['values']['date_time']['month'],
'date_day' => $form_state['values']['date_time']['day'],
'date_year'=> $form_state['values']['date_time']['year'],