Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejavascript
titleAdd a record using a primitive JavaScript object
var record = {
  id: counter,
  firstname: fname,
  lastname: lname
}
pjs.query("INSERT INTO table SET ?", record);
Add a Record
// .
Code Block
Add a record using a primitive JavaScript object
languagejavascript
title
Load
various
types
of
data
values
into
a
table
with
four
columns
var version = "12345";

var record = {};
record.OneField = version;                         // variable
record.TwoField = data[1].__SOMEFIELD;             // object property
record.RedField = "Suspended";                     // literal
record.BlueField = cvtDate (data[1].DUEDATE);     // function call

pjs.query ("INSERT INTO table SET ?", record)

...