Bug #16855 Updated: PHP ignores the pg_query.
| From: | d-m at eudoramail dot com | Date: | Sun, 28 Apr 2002 17:34:03 +0000 |
| Subject: | Bug #16855 Updated: PHP ignores the pg_query. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-6353@lists.php.net to get a copy of this message | ||
ID: 16855
Updated by: d-m@eudoramail.com
Reported By: d-m@eudoramail.com
Status: Bogus
Bug Type: PostgreSQL related
Operating System: Slackware 8.0 Kerel 2.4.19.7
PHP Version: 4.2.0
New Comment:
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 =
'$inLOGIN'")
or die ("Somethig wrong at the Query");
Could you sent me a sample of select ?!?
Thanks in addvance
Helio Ferenhof
Previous Comments:
------------------------------------------------------------------------
[2002-04-26 19:19:45] yohgaki@php.net
I meant
(or use 4.2.0's pgsql module with 4.1.2)
It should work.
------------------------------------------------------------------------
[2002-04-26 18:59:14] yohgaki@php.net
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 11:49:44] d-m@eudoramail.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)
VALIDADE LOGIN.php
$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 == "") {
include('header.inc');
echo "<font color=#FF9000> Oooooops!</font> User name or password
no
valid<BR> Try
agin";
include('footer.inc');
pg_close ($connection);
exit;
}
if ($inPASS == base64_decode($fetch[0])) {
$to_cookie = base64_encode("OK");
setcookie("admins",$to_cookie,NULL,NULL,NULL,0);
$to_cookie2 = base64_encode($inLOGIN);
setcookie("admin_login",$to_cookie2,NULL,NULL,NULL,0);
include('menu.html');
}
else {
include('header.inc');
echo "<font color=#FF9000> Oooooops!</font>Username or password
invalid<BR>try agin";
include('footer.inc');
}
pg_close ($connection);
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=16855&edit=1