Archive for 一月, 2006

JScript 仿 PHP 操作 SQL Server

Posted on 2006-01-13 in Web DevelopmentComments

原先在php下写了个操作数据库的类,用jscript又重写了一遍。

// Sample
var db = new dbstuff();
db.connect(dbserver, dbuser, dbpwd, dbname);

var sql = "SELECT @@VERSION as dbv";
var query = db.query(sql);
while(arr = db.fetch_array(query)){
  echo(arr["dbv"]);
}
db.close();

Continue reading…