gpt4 book ai didi

php - 在 Android 中使用 PHP 将数据作为 JsonArray 发送到 MySQL 的教程

转载 作者:行者123 更新时间:2023-11-29 19:44:41 25 4
gpt4 key购买 nike

我在 g*ogle 中尝试了几天,以找到任何好的教程。

但到目前为止,我还没有找到。

我在 android 中有一个 json :

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

并且字符串将 idnilai 循环五次,然后我想在按下按钮时将此 json 发送到服务器。

我想要存储的数据库如下所示:

|---|-----|
| ID|Nilai|
|---|-----|
| 1 | 1 |
| 2 | 1 |
|...| ... |

有什么建议或想法吗? 我不介意您是否使用申请中的代码来帮助回答,至少该代码可以帮助我

I could not try the code how to do, due to limited understanding of the android and php programming myself, but I can try the code when I have a reference or examples of similar cases

最佳答案

在服务器中使用 volley 库和 php 文件。

这里是一个有用的链接:

android developers volley

Volley json post tuturial

关于php - 在 Android 中使用 PHP 将数据作为 JsonArray 发送到 MySQL 的教程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41107092/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com