(PHP 4 >= 4.3.0, PHP 5, PHP 7)
pg_meta_data — 锟斤拷帽锟斤拷元锟斤拷锟斤拷
$connection
, string $table_name
) : arraypg_metadata() 锟斤拷锟斤拷锟斤拷锟斤拷式锟斤拷锟斤拷 table_name 锟斤拷亩锟斤拷濉�
锟剿猴拷锟斤拷锟斤拷实锟斤拷锟斤拷锟侥★拷锟剿猴拷锟斤拷锟侥憋拷锟襟,帮拷锟斤拷锟斤拷锟狡硷拷锟斤拷锟斤拷锟斤拷牡锟斤拷锟斤拷锟斤拷锟斤拷锟轿达拷锟斤拷锟� PHP 锟斤拷锟斤拷锟芥本锟斤拷未通知锟酵憋拷锟睫改★拷使锟矫憋拷锟斤拷锟斤拷锟斤拷锟斤拷锟皆碉拷 锟斤拷
connection
PostgreSQL database connection resource.
table_name
The name of the table.
锟斤拷锟斤拷锟斤拷 array 锟斤拷式锟斤拷锟截憋拷亩锟斤拷澹拷锟斤拷锟斤拷锟斤拷锟津返伙拷 FALSE
锟斤拷
Example #1 取锟矫憋拷锟皆拷锟斤拷锟�
<?php
$dbconn = pg_connect("dbname=publisher") or die("Could not connect");
$meta = pg_meta_data($dbconn, 'authors');
if (is_array($meta)) {
echo '<pre>';
var_dump($meta);
echo '</pre>';
}
?>
锟斤拷锟斤拷锟斤拷锟教伙拷锟斤拷锟斤拷锟�
array(3) { ["author"]=> array(5) { ["num"]=> int(1) ["type"]=> string(7) "varchar" ["len"]=> int(-1) ["not null"]=> bool(false) ["has default"]=> bool(false) } ["year"]=> array(5) { ["num"]=> int(2) ["type"]=> string(4) "int2" ["len"]=> int(2) ["not null"]=> bool(false) ["has default"]=> bool(false) } ["title"]=> array(5) { ["num"]=> int(3) ["type"]=> string(7) "varchar" ["len"]=> int(-1) ["not null"]=> bool(false) ["has default"]=> bool(false) } }