I have multiple lists (A,B,C etc) that are updated on a daily basis. From each of these lists, A, B, C etc, I am interested in one field each, FieldA, FieldB, FieldC etc that I would like to capture in a new list "summary". Typically, these would be either the last row (ordered by date), or I would like to grab that field based on date, and insert in this summary List.
So, a typical row in my summary list should like this -
id date_time FieldA FieldB FieldC
Would something like this php code grab the records?
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query
->select('fieldA')
->from('tableA')
->where('date_time = ' . $db->quote('today'));
$db->setQuery($query);
$fieldA = $db->loadResult();
Secondly, how do I automate this? I would like every days' record to be grabbed automatically and inserted into my summary list. Is it possible? Any assistance is much appreciated.
So, a typical row in my summary list should like this -
id date_time FieldA FieldB FieldC
Would something like this php code grab the records?
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query
->select('fieldA')
->from('tableA')
->where('date_time = ' . $db->quote('today'));
$db->setQuery($query);
$fieldA = $db->loadResult();
Secondly, how do I automate this? I would like every days' record to be grabbed automatically and inserted into my summary list. Is it possible? Any assistance is much appreciated.