1 回答
TA贡献2012条经验 获得超12个赞
看起来你的结构应该是
while ( $row = $result->fetch_assoc()) {
$rowarray['id'] = $row['ContractID'];
$rowarray['recipientOrganization'] = array(
"id" => $row['id'],
"companyNumber" => $row['companyNumber'],
"charityNumber" => $row['charityNumber'],
"name" => $row['name']
);
$rowarray['fundingOrganization'] = array(
"id" => $row['id'],
"name" => $row['name']
);
$rowarray['title'] = $row['Service_Name'];
$rowarray['currency'] = 'GBP';
//$rowarray['amountAppliedFor'] = $row['Sum_Requested'];
$rowarray['amountAwarded'] = $row['Sum_Approved'];
//$rowarray['awardDate'] = $row['Decision_Date'];
$dbdata['grants'][] = $rowarray;
}
我喜欢做的另一个技巧是将 json 放入 phpsandbox 并将其转换为数组以查看结构。
- 1 回答
- 0 关注
- 133 浏览
添加回答
举报