(PHP 4, PHP 5, PHP 7)
odbc_tableprivileges — Lists tables and the privileges associated with each table
$connection_id
, string $catalog
, string $schema
, string $name
) : resource|falseLists tables in the requested range and the privileges associated with each table.
connection_idEine ODBC-Verbindungsressource, siehe odbc_connect() für Details.
catalogDer Katalog ('Kennzeichner' in ODBC 2 Terminologie).
schema
Das Schema ('Besitzer' in ODBC 2 Terminologie).
Dieser Parameter akzeptiert die
folgenden Suchmuster: % für 0 oder mehr Zeichen und _
für genau ein beliebiges Zeichen.
name
The name.
Dieser Parameter akzeptiert die
folgenden Suchmuster: % für 0 oder mehr Zeichen und _
für genau ein beliebiges Zeichen.
An ODBC result identifierIm Fehlerfall wird FALSE zurückgegeben..
The result set has the following columns:
TABLE_CATTABLE_SCHEMTABLE_NAMEGRANTORGRANTEEPRIVILEGEIS_GRANTABLE
The result set is ordered by TABLE_CAT, TABLE_SCHEM,
TABLE_NAME, PRIVILEGE and GRANTEE.
Beispiel #1 List Privileges of a Table
<?php
$conn = odbc_connect($dsn, $user, $pass);
$privileges = odbc_tableprivileges($conn, 'SalesOrders', 'dbo', 'Orders');
while (($row = odbc_fetch_array($privileges))) {
print_r($row);
break; // further rows omitted for brevity
}
?>
Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:
Array
(
[TABLE_CAT] => SalesOrders
[TABLE_SCHEM] => dbo
[TABLE_NAME] => Orders
[GRANTOR] => dbo
[GRANTEE] => dbo
[PRIVILEGE] => DELETE
[IS_GRANTABLE] => YES
)