From:             [EMAIL PROTECTED]
Operating system: FreeBSD 4.4-STABLE
PHP version:      4.0.6
PHP Bug Type:     Scripting Engine problem
Bug description:  using postgres with DBA causes DBA not to be able to find any keys.

Hello,

If I use postgres first within a PHP script then DBA can not find any keys.
 

It will return the error:
"Warning: Unable to find DBA identifier 1 in
/www/sites/Test/htdocs/dbafuncs.php on line 31"

If I do not use a pg_connect, then it works perfectly.

Here is a short script that triggers it.

--SNIP--
$dbh = pg_connect("dbname=helpme user=helpme");
 
  if (!$dbh) {
    die ("Could not connect to the server");
  }
 
pg_close($dbh);
 
$dbalocation = "/www/sites/Test/xxadmindb";
echo "$dbalocation<br><br>";
 
$dbm = dba_open("$dbalocation", "r", "ndbm") || die ("Could not open
file");
 
  if(!$dbm) {
    die ("no handle");
  }
 
$key = dba_firstkey($dbm);
 
  if(!$key) {
    echo "<br><br>Error with retreiving Key<br><br>\n";
  }
 
$info[$key] = dba_fetch($key, $dbm);
 
  while($key != false) {
    $key = dba_nextkey($dbm);
      if(!$key) { break; }
    $info[$key] = dba_fetch($key, $dbm);
  }
 
dba_close($dbm);

--SNIP--

The dba_open works just fine and returns a handle, however anything that
needs a key will fail with the above error.

GB Clark
-- 
Edit bug report at: http://bugs.php.net/?id=14383&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to