Loading...
 

DAL method: Delete()

Deletes one or more records from the database.
Syntax
Delete()
Arguments
No arguments.
Return value
No return value.
Example 1
Delete all records where ID is '32':
PHP
global $dal;
$tblUsers = $dal->Table("UsersTable");
$tblUsers->Param["ID"]=32;
$tblUsers->Delete();
ASP
dal.Table("UsersTable").Param("ID")=32
dal.Table("UsersTable").Delete()
The corresponding SQL query:
SQL
Delete from UsersTable where ID=32
Example 2
Delete all records where FirstName is 'Bob' and Email is 'test@test.com':
PHP
global $dal;
$tblUsers = $dal->Table("UsersTable");
$tblUsers->Param["FirstName"]="Bob";
$tblUsers->Param["Email"]="test@test.com";
$tblUsers->Delete();
ASP
dal.Table("UsersTable").Param("FirstName")="Bob"
dal.Table("UsersTable").Param("Email")="test@test.com"
dal.Table("UsersTable").Delete()
The corresponding SQL query:
SQL
Delete from UsersTable where FirstName='Bob' and Email='test@test.com'

See also