I'm accessing an mssql db in PHP and creating the connection as a new COM() object. My query runs perfectly fine. When I do the query in Microsoft SQL Server 2008, everything looks great, the dates/times show up in columns and are readable.
But when I run the same query and return the results in PHP, I go to iterate through the results like so:
$selected_fields = array("FS.fund_name", "M.media_id", "MT.media_type_name", "modified_date", "file_upload_date", "issued_date", "filename");
//query goes here
$record_set = new COM("ADODB.Recordset");
while(!$record_set->EOF){ //loop through query results and add to inline cache variable
$temp_record = array();
foreach($selected_fields as $fieldname){ //go through fields and add to array
$fieldname_array = explode(".", $fieldname); //separate table and column
$fieldname = $fieldname_array[sizeof($fieldname_array)-1];
$temp_record[$fieldname] = $record_set->fields[$fieldname]->value;
}
print_r($temp_record);
$rs_array[] = $temp_record;
$record_set->movenext();
}
As I print each $temp_record, they end up looking like this:
Array ( [fund_name] => TEST [media_id] => 1001 [media_type_name] => 8937 Tax Forms [modified_date] => variant Object [file_upload_date] => variant Object [issued_date] => variant Object [filename] => form8937test.pdf )
So the dates are some kind of object, and I don't know how to access them in PHP. And when I go to save them as a cache file, they have this value:
variant::__set_state(array())
How can I retrive the date/time in a format that I can then manipulate using PHP? I want to filter them by year, and sort them by most recent.