Loading...
 

DAL.whereAdd()

Adds new AND condition to the existing WHERE clause.
Syntax
PHP
whereAdd($where, $condition)
ASP
whereAdd(where, condition)
Arguments
where - WHERE clause. Example: "ID=19".
condition - any condition clause. Example: "CustomerID='123'".
Return value
Returns updated WHERE clause.
Example
Add new AND condition to the existing WHERE clause:
PHP
// all orders placed after January 1, 2009
$where = "OrderDate>'2009-01-01'";
// all orders placed by customer ALFKI after January 1, 2009
$where = whereAdd($where, "CustomerID='ALFKI'");
ASP
' all orders placed after January 1, 2009
where = "OrderDate>'2009-01-01'"
' all orders placed by customer ALFKI after January 1, 2009
where = whereAdd(where, "CustomerID='ALFKI'")

See also

  • Example: Dynamic SQL Query