Page 1 of 1

Writing a variable to a table

Posted: Sun Feb 08, 2015 8:49 am
by dragon73
How do I write a variable to a table directly in JavaScript?

I want to do something like:

Code: Select all

//variable "test" is a CSV string
text = Global.GetVar("test");
array = text.split(",")
array_length = array.length
for (i=0, i < array_length, i++) {
    var name_tmp = array[i];
    Global.DataBase.Query(INSERT INTO table1 (name) VALUE (name_tmp);
}
Basically, I need to split a string into parts and then write it to a single column table with a row for each split. I don't need a table ID for this table. Thanks.