Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

425
Visualizações
How to save multidimensional array into a file or mysql

I want to track user interaction with a plugin written in jquery which is storing some multi-mensional arrays. I want to save those arrays into mysql database or into a file which I can display later.

The array looks like this:

var data = [ [381, 143, 0, 0, 0, 250, 1],[367, 147, 0, 0, 0, 250, 2],[367, 147, 0, 0, 1, 249, 3] ];

Basically this plugin just records positions into the arrays and displays animation on screen where the user clicks.

Here is an example how this script is working:

 var myRecord =new viewRec({interval:250});
 var data = [ [381, 143, 0, 0, 0, 250, 1],[367, 147, 0, 0, 0, 250, 2],[367, 147, 0, 0, 1, 249, 3] ];
 myRecord.setData(data);
 myRecord.play();
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

You might want to JSON.stringify(data, null, ' ') to make the array into a JSON and then write the JSON to MySQL.

When you want to get the data, get it from MySQL and do JSON.parse(datafrommysql); to get the multidimensional array for your processing needs.

JSON vs XML : https://www.w3schools.com/js/js_json_xml.asp
Documentation on JSON supported data types : https://www.w3schools.com/js/js_json_datatypes.asp
Documentation on JSON.parse : https://www.w3schools.com/js/js_json_parse.asp
Documentation on JSON.stringify : https://www.w3schools.com/js/js_json_stringify.asp

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda