I've been using php to retrieve information from an MS SQL database. All been fine tile I tried to retrieve a date and time format from the table.
This is the php I've been using:
$tsql5a = "SELECT * FROM FactTime";
$stmt5a = sqlsrv_query( $conn, $tsql5a);
$data5a = "";
while( $row = sqlsrv_fetch_array( $stmt5a, SQLSRV_FETCH_NUMERIC)){
$data5a .= "$row[1],";
}
$data5a = substr($data5a,0,strlen($data5a)-1);
The date format I'm retrieving from the table is:
2014-10-01 00:59:00.000
I'm getting the following error:
"Catchable fatal error: Object of class DateTime could not be converted to string"
I've looked through similar issues and they suggest a conversion to a string but I'm not certain at all of how to add this into the existing php.
Can anyone help.
Thanks Rob