dongwo1914 2016-12-09 15:42
浏览 69

android - 如何将android中的多个数据json发送到mysql数据库?

I've tried to search the tutorial in go*gle, but I'm not yet find out what I need.

how do you send a multiple Json data in android to mysql server through php script?

let say that I have a json data like this :

[{"id":"1","nilai":"1"},{"id":"2","nilai":"1"},{"id":"3","nilai":"1"},{"id":"4","nilai":"1"},{"id":"5","nilai":"1"}]

then when button pressed. the json data will be inserting into mysql like this :

Table : nilai_2
|---------|----------|
| id      | nilai    |
|---------|----------|
|1        | 1        |
|2        | 1        |
|3        | 1        |
|4        | 1        |
|5        | 1        |
|---------|----------|

I know how to send a single data in android to mysql, but to send multiple data all at once?? what should i do?

please explain me.

  • 写回答

1条回答 默认 最新

  • dongrao9454 2017-12-17 00:09
    关注

    If you can send single data then your android code is okay. Just make sure you have a proper Json format to put in your params. Focus on your php code, make sure you have appropriate post methods that will read your json data. Convert that to array object while inserting them one by one into your mysql. Probably you might want to post your PHP code to help us understand better.

    评论

报告相同问题?

悬赏问题

  • ¥20 软件测试决策法疑问求解答
  • ¥15 win11 23H2删除推荐的项目,支持注册表等
  • ¥15 matlab 用yalmip搭建模型,cplex求解,线性化处理的方法
  • ¥15 qt6.6.3 基于百度云的语音识别 不会改
  • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单
  • ¥15 神经网络怎么把隐含层变量融合到损失函数中?
  • ¥15 lingo18勾选global solver求解使用的算法
  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
  • ¥20 测距传感器数据手册i2c
  • ¥15 RPA正常跑,cmd输入cookies跑不出来