Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

417
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!