|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16855 PHP ignores the pg_query.
Submitted: 2002-04-26 11:49 UTC Modified: 2002-04-28 22:16 UTC
From: d-m at eudoramail dot com Assigned:
Status: Not a bug Package: PostgreSQL related
PHP Version: 4.2.0 OS: Slackware 8.0 Kerel
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.
Block user comment
Status: Assign to:
Bug Type:
From: d-m at eudoramail dot com
New email:
PHP Version: OS:


 [2002-04-26 11:49 UTC] d-m at eudoramail dot com
In php 4.2.0 the same php that I run at 4.1.2 do not return the values of the select.

Anyone know why do not work at 4.2.0 ? Its a bug or something changes a lot??!

SAMPLE (This code run at 4.1.2 and dono at 4.2.0)

   $connection = pg_connect("host=localhost port=5432 dbname=admins user=myuser password=PASSWORD")
      or die ("I Could not connect to PostGres --> " . pg_errormessage($conn));

  $result=pg_exec($connection, "SELECT pass FROM adm WHERE login = '$inLOGIN'")
    or die ("Somethig wrong at the Query");
  $num = pg_numrows($result);
  if ($num != 0)
        $fetch = pg_fetch_row($result, 0);

  $TiTuLo = "DB Varilux Admin";
  $BaCk   = "index.html";

  if ($inPASS == "") {
      echo "<font color=#FF9000> Oooooops!</font> User name or password no valid<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Try agin";
      pg_close ($connection);
  if ($inPASS == base64_decode($fetch[0])) {

    $to_cookie = base64_encode("OK");
    $to_cookie2 = base64_encode($inLOGIN);

  else {
      echo "<font color=#FF9000> Oooooops!</font>Username or password invalid<BR>try agin";
  pg_close ($connection);


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-26 18:59 UTC]
If you need portablility, please used old names mentioned in manual pages. (use 4.2.0 pgsql module with 4.1.2)

 [2002-04-26 19:19 UTC]
I meant 
(or use 4.2.0's pgsql module with 4.1.2)
It should work.
 [2002-04-28 13:34 UTC] d-m at eudoramail dot com
I think you dont understand my problem.
I wanna make a simple select but PHP 4.2 do not returns the lines of the select after the $fetch = pg_fetch_row($result, 0); WHY? The php 4.2 changes the method of making a select ?!? is not more like $result=pg_exec($connection, "SELECT pass FROM adm WHERE login =
    or die ("Somethig wrong at the Query");

Could you sent me a sample of select ?!?

Thanks in addvance 
Helio Ferenhof
 [2002-04-28 22:16 UTC]
If you need sample scirpts, it's under ext/pgsql/test/.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 19:01:28 2024 UTC