Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

printing the response from a WWWForm

Discussion in 'Scripting' started by hai_ok, Dec 6, 2007.

  1. hai_ok

    hai_ok

    Joined:
    Jun 20, 2007
    Posts:
    193
    on this page:
    http://unity3d.com/support/documentation/ScriptReference/WWW.html
    of the docs, it shows how to submit a few fields to a url, get a reply and then it says:

    Code (csharp):
    1. // show the highscores
    Would be great if I could see how to handle the returned data as a string.
    I'm working on parsing this and interacting with a database.

    If anyone's interested, I'll post a "how to do this" or something. I think it will be very powerful and expose some very cool possibilities. I'm using .Js in Unity and PHP and MySQL on the remote end.

    Thanks!
     
  2. seon

    seon

    Joined:
    Jan 10, 2007
    Posts:
    1,441
    The url.data is returned as a string, that you can search, split, format and do anything you want with.

    So, you need to work out (a) how you are going to format the result from your database, and (b) what you need to do in Unity to rip apart the single string that gets returned so you can format it.

    You could write a basic CSV parser that splits your string by a specified delimiter or put special codes inside your string that you search for in unity to use as formatting placeholders.

    It really just depends on what you need.
     
  3. hai_ok

    hai_ok

    Joined:
    Jun 20, 2007
    Posts:
    193
    I really appreciate your help.

    GOT IT!!!

    Thanks so much!!! you mean 'download.data'

    This makes so much sense now!

    Thank you very much!!!

    StuntMania and Turret Wars are both awesome games!
    I have to tell you that.