odbc_table()函數(shù)用來獲取存儲在特定數(shù)據(jù)源中的表名稱列表
resource odbc_tables ( resource $connection_id [, string $qualifier [, string $owner [, string $name [, string $types ]]]] )
它用于獲取存儲在特定數(shù)據(jù)源中的表名列表
成功返回odbc結(jié)果標識符,否則返回false
| 序號 | 參數(shù)和說明 |
|---|---|
| 1 | connection_id 它包含有關連接標識符的信息 |
| 2 | qualifier 它包含有關限定符的信息 |
| 3 | owner 它包含有關所有者的信息 |
| 4 | name 它包含有關表名的信息 |
試試下面的實例
<?php
$dbh = odbc_connect($dsn, $user_id, $pwd_id);
$result = odbc_tables($dbh);
$tables = array();
while (odbc_fetch_row($result)){
if(odbc_result($result,"TABLE_TYPE")=="TABLE")
echo" ".odbc_result($result,"TABLE_NAME");
}
?>