Bug #13604: odbc_primarykeys with Access

From: Date: Mon, 08 Oct 2001 20:58:03 +0000
Subject: Bug #13604: odbc_primarykeys with Access
Groups: php.dev 
Request: Send a blank email to php-dev+get-67570@lists.php.net to get a copy of this message
From: phperror@gustl.at Operating system: W98, W98SE PHP version: 4.0.6 PHP Bug Type: ODBC related Bug description: odbc_primarykeys with Access Hi, i don't get odbc_primarykeys () working with access-dbs. example: <?php $dsn = "accessdsn"; $user = ""; $pass = ""; $db = "accessdb"; # $dsn = "mssqldsn"; $user = ""; $pass = ""; $db = "mssqldb"; # $dsn = "mysqldsn"; $user = ""; $pass = ""; $db = "mysqldb"; $con = odbc_connect ($dsn, $user, $pass) or die ("no connect to $dsn"); $res = odbc_tables ($con, $db, "", "%", "'TABLE'") or die ("no tables in $db of $dsn"); odbc_result_all ($res); echo "<h2>Tables in db $db of $dsn</h2>"; $res = odbc_tables ($con, $db, "", "%", "'TABLE'") or die ("no tables in $db of $dsn"); while (odbc_fetch_row ($res)) { $qualifiers [] = odbc_result ($res, 1); $owners [] = odbc_result ($res, 2); $tables [] = odbc_result ($res, 3); } print_r ($tables); reset ($tables); while (list ($i, $table) = each ($tables)) { echo "<h2>keys of ".$table." (".$qualifiers [$i].", ".$owners [$i].")</h2>"; $res = odbc_primarykeys ($con, $qualifiers [$i], $owners [$i], $table); if ($res) odbc_result_all ($res); else echo (odbc_error ().": ".odbc_errormsg ()."<BR>"); } ## ## must close, otherwise php 4.05RC1, 4.06 crashes ## odbc_close ($con); echo ("ende"); ?> in PHP4.06 I get the following php errormsg: Warning: SQL error: , SQL state 00000 in SQLPrimaryKeys in c:/arbeit/test/odbc2.php4 on line 23 00000: I tried all the combinations of setting the parameters with spaces and/or "%", no chance. Gustav Graf -- Edit bug report at: http://bugs.php.net/?id=13604&edit=1

« previous php.dev (#67570) next »