DB Prepare

From FreeSWITCH Wiki
Jump to: navigation, search

This prepares the SQL statement for use.

Synopsis

prepare(statement)

Example

use("CoreDB");

var db = new CoreDB("js");
var sql="select * from users;";
db.prepare(sql);
while(db.next()) {
   hash = db.fetch();
   console_log("name = " + hash["name"] + " number " + hash["did"] + "\n");
}

See Also