## 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 id of record in index position 3 in mytable $id = db_get_id("mytable", 3);`

See also

Database functions
Database support