odbc_primarykeys

int odbc_primarykeys(resource conn, string catalog, string owner, string table) 

Displays primary key information.

Returns:

Result identifier; FALSE on error

Description:

Retrieves information about primary keys in a table. The columns returned are TABLE_CAT, TABLE_SCHEM, TABLE_NAME, KCOLUMN_NAME, KEY_SEQ, and PK_NAME.

Version:

Existing since version 4.0

Example:

Display primary key
$db = odbc_connect("DSN","user","pass"); 
$result = odbc_primarykeys($db,"Northwind", "dbo", "Categories"); 
odbc_result_all($result); 

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.