someone can tell me what is wrong in this code? I just want to get the last date in Joomla 2.5. Thanks
// Get a db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
$query
->select($db->quoteName('MAX(created)'))
->from($db->quoteName('#__content'))
$db->setQuery($query);
$result = $db->loadResult();
return $result;
don't quote functions:
$query
->select('MAX('.$db->quoteName('created').')')
->from($db->quoteName('#__content'));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With