0

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.

dondo
  • 99
  • 12

1 Answers1

0

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.