note 55018 added to function.odbc-tables
| From: | pmainsatuxdotcom at osu1 dot php dot net | Date: | Fri, 22 Jul 2005 14:39:25 +0000 |
| Subject: | note 55018 added to function.odbc-tables | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-92301@lists.php.net to get a copy of this message | ||
This probably works for a variety of formats, but if you want a list of *just* the table names from
an SQL dsn source (I'm using MSSQL), here's the code.
<?php
# ... assign $dsn, $uid, & $pwd ...
$dbh = odbc_connect($dsn, $uid, $pwd);
$result = odbc_tables($dbh);
$tables = array();
while (odbc_fetch_row($result))
array_push($tables, odbc_result($result, "TABLE_NAME") );
foreach( $tables as $t ) {
echo "$t\n";
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.odbc-tables.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+55018
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+55018&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+55018&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+55018&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+55018&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+55018&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+55018&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+55018&report=yes
Search -- http://master.php.net/manage/user-notes.php