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.

 

global $dal;
$tblUsers = $dal->Table("UsersTable");
$tblUsers->Param["ID"]=32;
$rs = $tblUsers->FetchByID();
while( $data = db_fetch_array($rs) )
{
  echo $data["UsersName"];
}

 

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

 

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