I setting up a webpage. The page is written in Perl/CGI but uses JavaScript for a variety of reasons.
When the page loads, I would like to perform an SQL statement to find all records in a table and store each tuple into an array.
For example, if I had a table with the following columns:
id - name - email
and had the following info:
1 - Jack - jack@zzz.com
2 - John - john@zzz.com
3 - Mary - mary@zzz.com
I would like these JavaScript arrays to be populated when the page loads:
idArr[0] = 1
idArr[1] = 2
idArr[2] = 3
nameArr[0] = Jack
nameArr[1] = John
nameArr[2] = Mary
emailArr[0] = jack@zzz.com
emailArr[1] = john@zzz.com
emailArr[2] = mary@zzz.com
How could I do this?
TIA
When the page loads, I would like to perform an SQL statement to find all records in a table and store each tuple into an array.
For example, if I had a table with the following columns:
id - name - email
and had the following info:
1 - Jack - jack@zzz.com
2 - John - john@zzz.com
3 - Mary - mary@zzz.com
I would like these JavaScript arrays to be populated when the page loads:
idArr[0] = 1
idArr[1] = 2
idArr[2] = 3
nameArr[0] = Jack
nameArr[1] = John
nameArr[2] = Mary
emailArr[0] = jack@zzz.com
emailArr[1] = john@zzz.com
emailArr[2] = mary@zzz.com
How could I do this?
TIA