Gets the identifier of an indexed record in a table.
int db_get_id(string tablename, int index [, string idfield])
Returns the id found or NULL if no such identifier was found.
// Get the the id of record in indexposition 3 in mytable
$id = db_get_id("mytable", 3);