Search Unity

Getting a table from the server and putting it into a javascript array

Discussion in 'Scripting' started by Sargon_of_Akkad, Dec 4, 2012.

  1. Sargon_of_Akkad

    Sargon_of_Akkad

    Joined:
    Jan 16, 2011
    Posts:
    147
    I need to know the best way of fetching an entire table from the server and then inserting each row into a multi-dimensional javascript array. Retrieving the data is no problem (SELECT * FROM table) but how do I then break it down and insert it into the array?

    Thanks in advance.
     
  2. Sargon_of_Akkad

    Sargon_of_Akkad

    Joined:
    Jan 16, 2011
    Posts:
    147
    So after much trawling it seems that all of the data from the table needs to be put into a (big) string that can be returned via an echo statement. Is this really the best way to do it? It seems that this string is going to reach ridiculous proportions.