Using PHP to query a MDB file, and return JSON

前端 未结 4 1113
你的背包
你的背包 2021-01-25 07:46

I have a Microsoft Access Database, and I am trying to query the table using PHP, and output valid JSON. I have an equivalent code for a MSSQL database, am I am trying to make m

4条回答
  •  北恋
    北恋 (楼主)
    2021-01-25 08:01

    You only need 1 loop, fetchAll is your iterable friend:

    while ($row = $data->fetchAll(SQLSRV_FETCH_ASSOC)) {
        $result[] = $row;   
    }
    

提交回复
热议问题