Please enable JavaScript to view this site.

Navigation: » No topics above this level «

DAL method: QueryAll() (Deprecated)

Scroll Prev Next More

 

Deprecated

This function is deprecated and we recommend using the DB:Query() function from Database API.

 

Selects all records from the table.

Syntax

QueryAll()

Arguments

No arguments.

Return value

Returns the recordset on success or FALSE on error.

Example

Send mass email to all users:

 

var rs = GlobalVars.dal.Table("UsersTableName").QueryAll();
XVar data;
var rmail = XVar.Array();
while (data = CommonFunctions.db_fetch_array(rs))
{
  rmail["to"] = data["EmailAddress"];
  rmail["body"] = "Check what's hot this season";
  rmail["subject"] = "Monthly newsletter";
  var ret = MVCFunctions.runner_mail(rmail);
  if(!ret["mailed"])
    MVCFunctions.Echo(ret["message"]);
}

See also:

runner_mail function

DAL Method: Query

DAL Method: CustomQuery

DB API: Query

Database API

About Data Access Layer