Hi I'm trying to insert the json array into my MySQL database.With array json data from android client.
[{"name":"peter","phone":"dsf","city":"sdfsdf","email":"dsf"},{"name":"111","phone":"222","city":"hn","email":"[email protected]"}]
Hi I'm trying to insert the json array into my MySQL database.With array json data from android client.
|
||||
|
If you want to store the array as a string, you can use JSON.stringify():
The variable $json is then a simple string which can be inserted into MySQL easily. You can then use:
To convert the string back to an array. This method usually isn't recommended for performance reasons though, so you might alternatively want to break up the array and store each field individually. |
||||
|
Try this: $json = serialize(json_array); |
|||
|
Use |
|||
|
you can use -
|
||||
|