db_get_id

int db_get_id (string tablename, int index [, string idfield])

Gets the identifier of an indexed record in a table.

Arguments

tablename is the name of the table to be examined.
index is the index position within the table.
idfield is the name of identifier field (column). Default is "id" .

Result

Returns the id found or NULL if no such identifier was found.

Example

// Get the the id of record in indexposition 3 in mytable

$id = db_get_id("mytable", 3);


See also

Database functions
Database support