Please enable JavaScript to view this site.

Navigation: » No topics above this level «

DAL method: CustomQuery (Deprecated)

Scroll Prev Next More

 

Deprecated

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

 

Runs a custom SQL query.

Syntax

CustomQuery($sql)

Arguments

$sql

a SELECT clause. Example: "select * from UsersTable where ID=32".

Return value

Returns the recordset.

Example 1

A query that doesn't return data:

 

$sql = "update Users set active=0 where id=32";
CustomQuery($sql);

 

Example 2

A query that returns data:

 

$sql = "select count(*) as c from orders group by customerid";
$rs = CustomQuery($sql);
$data = db_fetch_array($rs);
echo "Number of customers: " . $data["c"];

See also:

DAL Method: Query

DAL Method: QueryAll

DB API: Query

Database API

Example: Update multiple records on the List page

About Data Access Layer

 

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