I struggling with saving date into custom Joomla table. This code creating error for me:
Code: Select all
$db = JFactory::getDbo();
$date = new JDate('now');
$query = $db->getQuery(true);
$columns = array('user_id', 'last_czytanie');
$values = array('15', $date); //this line create error
$query
->insert($db->quoteName('custom_czytane'))
->columns($db->quoteName($columns))
->values(implode(',', $values));
$db->setQuery($query);
$db->execute();
I was trying:
Code: Select all
$values = array('15', '2018-01-01');
Code: Select all
$values = array('15', '2018-01-01 01:01:01');
What I am doing wrong?
Best regards
Arek