|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-12-18 07:54 UTC] jlim at natsoft dot com
The following code:
<?php
error_reporting(E_ALL);
$conn = odbc_connect("netsdk", "yyyy", "xxxx") or die("FAIL CONNECTION");
print "Connected <br>";
print "ODBC_Tables<br>";
$trs = odbc_tables($conn);
odbc_free_result($trs);
print "ODBC_Columns<br>";
$colrs = odbc_columns($conn);
odbc_free_result($colrs);
print "Done<br>";
?>
Will generate the output:
Connected
ODBC_Tables
ODBC_Columns
Warning: SQL error: , SQL state 00000 in SQLColumns in d:\inetpub\wwwroot\php\hs~a.php on line 10
Warning: odbc_free_result(): supplied argument is not a valid ODBC result resource in d:\inetpub\wwwroot\php\hs~a.php on line 11
Done
However, the following code with odbc_tables commented out:
<?php
error_reporting(E_ALL);
$conn = odbc_connect("netsdk", "adodb", "natsoft") or die("FAIL CONNECTION");
print "Connected <br>";
/*print "ODBC_Tables<br>";
$trs = odbc_tables($conn);
odbc_free_result($trs);*/
print "ODBC_Columns<br>";
$colrs = odbc_columns($conn);
odbc_free_result($colrs);
print "Done<br>";
?>
Works fine with the output:
Connected
ODBC_Columns
Done
Hope this was clear.
Regards, John Lim
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 17:00:01 2025 UTC |
I just ran into this problem with latest PHP and MSDE2000 (SQL Server 2000 cut down editon). using somthing like the following does not work ... (pseudo code) $tables = odbc_tables($con) while ($t=$odbc_fetch_array($tables)) { odbc_columns($con,$t['TABLE_CAT'],$t['TABLE_SCHEM'],$t['TABLE_NAME']); <-- fails here display column results } but the following does work $tables = odbc_tables($con) while ($t=$odbc_fetch_array($tables)) array_push($tahbles_array,$t); odbc_free_result($tables); for (. $t in $tahbles_array .) { odbc_columns(..$t[name].) (as above) display column results odbc_free_result() }