From:             mansilla_g at yahoo dot com
Operating system: linux
PHP version:      4.3.11
PHP Bug Type:     PostgreSQL related
Bug description:  a pg_fetch_row result doesnt make string comparisons

Description:
------------
when you get a string from a pg_fetch_row function it cant be compared
with other string correctly, but if you use odbc_fetch_row it works, note
that i compare ($row[0] == "Guille"), even if i assign $a = "Guille" and
then i try to compare ($row[0] == $a) i get a wrong result, but it i use
odbc_fetch_row or odbc_fetch_array instead it works.

Reproduce code:
---------------
<?php
$conn = pg_pconnect("","","","","mydb");
$query = "Select nombre from empleados where id = 1";
$resultado = pg_Exec($conn, $query);
$row = pg_fetch_row($resultado);
echo ($row[0]);
if ($row[0] == "Guille") {
   echo ("$row[0] is = Guille"); } 
else {
   echo ("$row[0] is not Guille");
}
 ?>

Expected result:
----------------
Guille
Guille is = Guille

Actual result:
--------------
Guille
Guille is not Guille

-- 
Edit bug report at http://bugs.php.net/?id=34030&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=34030&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=34030&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=34030&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=34030&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=34030&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=34030&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=34030&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=34030&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=34030&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=34030&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=34030&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=34030&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=34030&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=34030&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=34030&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=34030&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=34030&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=34030&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=34030&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=34030&r=mysqlcfg

Reply via email to