I'm trying to get the data in this array, I simply need DATELOGGED and DATECLOSED to be set as variables so i can handle them elsewhere in my script, however no matter what i do i get an array containing the results and not just the results.
obviously my understanding of handling an array are not up to scratch, can anyone help point me in the right direction please as everything i have read so far doesn't seem to cover this.
multi-dimensional array?!?
Here's my Script so far:
//QUERY ASSYST
$assystQ =
"
SELECT
PRODUCT_N,
MAX(INCIDENT.INCIDENT_REF) MAX_INCIDENT_REF,
MAX(DATE_LOGGED) DATELOGGED,
MAX(inc_close_date) DATECLOSED,
DATEDIFF(DAY,MAX(DATE_LOGGED),GETDATE()) DAYS_SINCE
FROM INCIDENT
LEFT JOIN ITEM
ON INCIDENT.ITEM_ID = ITEM.ITEM_ID
LEFT JOIN PRODUCT
ON ITEM.PRODUCT_ID = PRODUCT.PRODUCT_ID
WHERE EVENT_TYPE = 'i'
AND INC_SERIOUS_ID = '$alertType'
AND product_n = '$assystProductName'
AND inc_status = 'c'
GROUP BY PRODUCT_N
";
$assystR = sqlsrv_query($assystconn, $assystQ);
while ($ResultOobj = sqlsrv_fetch_array($assystR))
{
// CONVERT RESULTS
$incidentReferance = $ResultOobj[MAX_INCIDENT_REF];
$incidentOpen = $ResultOobj[DATELOGGED];
//ECHO RESULTS
var_dump($incidentOpen);
echo "<br>Last Incident Referance: " .$incidentReferance;
};
Here's what the var_dump is returning
I just don't understand how to get that date out of the array and into a single string.
object(DateTime)#5 (3) { ["date"]=> string(26) "2014-10-20 09:41:40.140000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Dublin" }