這是採樣數據接收到PHP腳本如何用這個json數據生成mysql查詢?
[{"id":1,"due_date":"2011-09-03","due_amount":"48279.00","wo_interest":"45980.00"},
{"id":2,"due_date":"2011-10-03","due_amount":"48279.00","wo_interest":"45980.00"}]
和表中的字段是在該順序
loan_no,i_id,due_date,installment,due_amount,wo_interest
順序低於該匹配到JSON數據即時接收。
i_id,due_date,due_amount,wo_interest
如何將loan_no和installment添加到此並使用它進行mysql查詢?
順序無關緊要 - 既不在JSON對象中,也不在SQL查詢的列名中。 – phihag
從JSON解碼到數組,對數組進行排序,添加需要的內容,循環並每次執行查詢。 – daGrevis
然後不要對它進行分類。 :D – daGrevis