how to convert this json to database:
var obj = {
'one' : ['qq','rr'],
'pizda' : { }
}
and then retrive it and use it?
how to convert this json to database:
var obj = {
'one' : ['qq','rr'],
'pizda' : { }
}
and then retrive it and use it?
Assuming that the database runs on the webserver and you thus need to pass the JSON as a string around between webserver and webbrowser, then the answer depends on the server side language you're using.
If you're using PHP, then you can convert between a JSON string and a PHP array using json_decode() and json_encode()
If you're using JSP/Java, then there are several libraries available to convert between a JSON string and a Java object, the popular ones being Google Gson, JSON.org and Jackson.
If you're using ASP/.NET, then there are several libraries available as well, under each Google JSONSharp.
Also see the bottom of this page for an overview of several JSON parsers/formatters in various languages.