"Packing" a Dataface Records object
Posted: Thu Aug 09, 2012 3:29 pm
So, I'm moving along on my custom dashboard page. I have some data normalized across a few tables, so I went from this:
To this:
But now, it's no longer a DF Recordset object, so member functions like 'getURL' don't work anymore. Am I going about this the right way? Is there a way to just 'pack' the recordset object with my array once I get it? Or am I missing out on some DF function that is equivalent to mysql_query but returns a Recordset?
Thanks again.
- Code: Select all
$events = df_get_records_array('calendar', array());
df_display(array('events'=>$events), 'dashboard.html');
To this:
- Code: Select all
$result = mysql_query ("SELECT `event_start_time` , `event_end_time` , `short_desc` , maint_types.description AS maint_type, vendors.vendor_name AS vendor_name, ".
"`trouble_ticket_number` , personnel.personnel_name AS assigned_to, `city` , states.postal_abbr AS state, `notes` , `submitted_by` , `submitted_date` ".
"FROM `calendar` ".
"LEFT JOIN maint_types ON ( calendar.type_id = maint_types.type_id ) ".
"LEFT JOIN personnel ON ( calendar.assigned_to_id = personnel.personnel_id ) ".
"LEFT JOIN states ON ( calendar.state_id = states.state_id ) ".
"LEFT JOIN vendors ON ( calendar.vendor_id = vendors.vendor_id )", $app->db());
while ($row = mysql_fetch_assoc($result))
{
$events[] = $row;
}
df_display(array('events'=>$events), 'dashboard.html');
But now, it's no longer a DF Recordset object, so member functions like 'getURL' don't work anymore. Am I going about this the right way? Is there a way to just 'pack' the recordset object with my array once I get it? Or am I missing out on some DF function that is equivalent to mysql_query but returns a Recordset?
Thanks again.