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.
var tblUsers = GlobalVars.dal.Table("UsersTable");
tblUsers.Param["ID"] = 32;
XVar rs = tblUsers.FetchByID();
XVar data;
while(data = CommonFunctions.db_fetch_array(rs))
MVCFunctions.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 carsusers where ID=32
See also:
•QueryResult object: fetchAssoc