CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: JSON format

  1. #1
    Join Date
    Apr 2012
    Location
    Slovenia
    Posts
    259

    JSON format

    hi,

    I created a function that returns an id field and proverb field in mysql.
    Right now my function returns this row:
    Code:
    1"The die is cast"
    In xml format this would probably look like this
    Code:
    <ID>1<\ID>
    <Proverb>"The die is cast"<\Proverb>
    I would like to know how would this row look like in JSON fomrat?

  2. #2
    Join Date
    Jan 2006
    Location
    Singapore
    Posts
    6,765

    Re: JSON format

    It would probably be:
    Code:
    {"ID": 1, "Proverb": "The die is cast"}
    or if the double quotes are really part of the Proverb, then:
    Code:
    {"ID": 1, "Proverb": "\"The die is cast\""}
    You should take a look at the syntax's description at json.org.
    C + C++ Compiler: MinGW port of GCC
    Build + Version Control System: SCons + Bazaar

    Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
    Kindly rate my posts if you found them useful

  3. #3
    Join Date
    Apr 2012
    Location
    Slovenia
    Posts
    259

    Re: JSON format

    hm, i guess it is better that i remove double quotes in mysql database.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured