Whether these function work depend on the database you're trying to access. These functions will not work with MS Access. They do however work with MYSQL, SQL Server and postgreSQL.
try this code;
$res = odbc_primarykeys($dsn,"","",$table);
$i = 0;
if($res)
{
do
{
$qualifier[$i] = odbc_result($res,1);
//or any other cod you desire
$i++;
}
while(odbc_fetch_row($res));
}
Same thing with foreign keys
$res = odbc_foreignkeys($conn,"","",$pKTable,"","",$fKTable);
This will give you the fields in $pKTable that are referenced by fields in $fKTable.
Use % as a wildcard character instead of one of the variables for different combinations of results.