How to insert json array into mysql database

前端 未结 6 953
春和景丽
春和景丽 2020-12-05 11:46

Hi I\'m trying to insert the json array into my MySQL database. I\'m passing the data form my iphone there i have converted the data into json format and I\'m passing the da

6条回答
  •  失恋的感觉
    2020-12-05 12:01

     $json = file_get_contents('php://input');
     $obj = json_decode($json,true);
    

    I think you are passing the wrong variable. You should pass $json in json_decode as shown above.

提交回复
热议问题