Please enable JavaScript to view this site.

Navigation: » No topics above this level «

DAL method: FetchByID() (Deprecated)

Scroll Prev Next More

 

Deprecated

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

 

Selects one or more records from the database that matches the condition.

Syntax

FetchByID()

Arguments

No arguments.

Return value

Returns the recordset on success or FALSE on error.

Example

Select all records where ID is '32'. To fetch a returned row as an associative array, use the db_fetch_array function.

 

dim tblUsers, rs
set tblUsers = dal.Table("UsersTable")
tblUsers.Param("ID") = 32
doAssignmentByRef rs, tblUsers.FetchByID()
do while bValue(DoAssignment(data,db_fetch_array(rs)))
  response.write data("UsersName")
loop

 

Note: the db_fetch_array function is deprecated, and we recommend using the fetchAssoc function instead.

 

The corresponding SQL query:

 

select * from UsersTable where ID=32

See also:

QueryResult object: fetchAssoc

DAL method: DBLookup

DB API: Select

DB API: LastId

Database API

About Data Access Layer