In my android application, I am querying a mysql database for a specific food id.
Example:
Food A - (food_id 5)
Food A is part of three food groups, each with their own unique ID.
Example:
Meal A - (meal_id = 3),
Meal B - (meal_id = 8),
Meal C - (meal_id = 20)
I am currently connecting to the mysql database via php, and can successfully query for the food_id in question and receive the JSON response into my android application.
I am stuck how to then pass it back through php/JSON to create three mysql rows (one for each meal returned) which will include some extra information added onto it in some new fields. Would I best be served by passing an array from android to my php service? How would this look?
Just use an
HttpClientto make a request back to the PHP application endpoint where you want to handle the incoming data, POSTing the data you want to work with on the server. You can post in whatever format suits you – query string, JSON, etc.