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:

 

global $dal;
//select emails from Users table
$tblUsers = $dal->Table("UsersTableName");
$rs = $tblUsers->QueryAll();
while ($data = db_fetch_array($rs))
{
$email.=$data["EmailAddress"].", ";
$from="[email protected]";
$msg="Check what's hot this season";
$subject="Monthly newsletter";
$ret=runner_mail(array('to' => $email, 'subject' => $subject, 'body' => $msg, 'from'=>$from));
if(!$ret["mailed"])
  echo $ret["message"]."<br>";
}

See also:

runner_mail function

DAL Method: Query

DAL Method: CustomQuery

DB API: Query

Database API

About Data Access Layer

 

Created with Help+Manual 7 and styled with Premium Pack Version 3 © by EC Software