The return of sqlsrv_fetch_array

Source: Internet
Author: User
For sqlsrv_fetch_array, please kindly advise that I am a newbie & nbsp; recently I have a PHP + sqlserver Project & nbsp; initially, the database is locally installed & nbsp; the mssql_query is correct. & nbsp; later, the database is no longer installed in the local machine & nbsp; the data cannot be connected to & nbsp; so the sqlsrv _ sqlsrv_fetch_array is used.
I am a newbie recently made a PHP + sqlserver project. at the beginning, the mssql_query database is installed locally. No problem occurs. later, the database is no longer installed on the local machine and cannot be connected. so I switched to sqlsrv_query but there are new problems. when sqlsrv_fetch_array is used, once there is a datatime type in the database, the data cannot be returned. if the error occurs, Baidu hasn't found the cause for a long time.
------ Solution --------------------
For this DateTime Object, you can use echo $ row ['datetime']-> getTimestamp (); or echo $ row ['datetime']-> format ('Y-m-d H: I: s.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.