php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7687 Another not a valid postgresql index
Submitted: 2000-11-07 23:43 UTC Modified: 2000-12-07 12:05 UTC
From: mrbig at sch dot bme dot hu Assigned:
Status: Closed Package: PostgreSQL related
PHP Version: 4.0.3pl1 OS: Debian 2.2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mrbig at sch dot bme dot hu
New email:
PHP Version: OS:

 

 [2000-11-07 23:43 UTC] mrbig at sch dot bme dot hu
Another the same problem, I've tried to write a script that cleanly reproduces what happened:

<?
   $dblocation="localhost";
   $dbname="mydb";

function TryHere () {
   global $dblocation, $dbname;
   $database=pg_Connect($dblocation,"","",$dbname);
   $datein=pg_exec($database,"select datetime 'now';");
   pg_Close($database);
   $file=fopen('/tmp/some.file.txt','r');
   if (pg_NumRows($datein)) {
      $row=pg_Fetch_Array($datein,0);
      echo "Date is: $row[0]<br>\n";
   }
   fclose($file);   
   #
   # Everything worked fine
   # 
} 

function TryHereAgain () {
   global $dblocation, $dbname;
   $database=pg_Connect($dblocation,"","",$dbname);
   $datein=pg_exec($database,"select datetime 'now';");
   pg_Close($database);   
   if (pg_NumRows($datein)) {
      $row=pg_Fetch_Array($datein,0);
      echo "Date is: $row[0]<br>\n";
   }
   #
   # Mmm... Not anymore :(
   #
}

   TryHere();
   TryHereAgain();
?>

If I ommit to open a file, or to use any of the pg_NumRows or pg_Fetch_Array at the first call of the routine everything is ok. Also if I do the same things, but without functions. Quite interesting...

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-11-08 00:25 UTC] mrobinso@php.net
Is it possible for you to try a newer version of PHP?
You can download a snapshot here:

http://snaps.php.net

I think there is a fix in CVS related to this.

You might want to note that the syntax you are using in
your pg_connect() call has been deprecated. There is info
at http://www.php.net/manual/ref.pgsql.php related to this.


 [2000-12-07 12:05 UTC] sniper@php.net
No feedback.
Reopen, if this still happens when using latest snapshot
from http://snaps.php.net/

--Jani
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 15:01:30 2024 UTC