#34030 [Fbk->Opn]: a pg_fetch_row result doesnt make string comparisons

From: Date: Tue, 09 Aug 2005 19:05:18 +0000
Subject: #34030 [Fbk->Opn]: a pg_fetch_row result doesnt make string comparisons
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-83260@lists.php.net to get a copy of this message
 ID:               34030
 User updated by:  mansilla_g at yahoo dot com
 Reported By:      mansilla_g at yahoo dot com
-Status:           Feedback
+Status:           Open
 Bug Type:         PostgreSQL related
 Operating System: linux
 PHP Version:      4.3.11
 New Comment:

Yes, you're right, this is not a bug and i apoligeze for making that
notice, altough i'd like to know why the same syntax worked using odbc
(even when there are blank spaces)? does odbc use trim() ? thank you
and once again sorry.


Previous Comments:
------------------------------------------------------------------------

[2005-08-09 10:17:43] sniper@php.net

As you see, it's 50 chars long? What type of column is that..? Have you
heard about trim() ? :)


------------------------------------------------------------------------

[2005-08-09 09:36:58] mansilla_g at yahoo dot com

string(50) "Guille "

------------------------------------------------------------------------

[2005-08-09 09:10:54] sniper@php.net

Can you PLEASE paste the output of the script with var_dump() in it??


------------------------------------------------------------------------

[2005-08-09 01:04:26] mansilla_g at yahoo dot com

the result is the same, the trouble is not to print the output, the
trouble is that when you retrieve a string this can not be compared,
"var_dumping" tells me string(50) "Guille ", so the result is "Guille
"
i mean $row[0] = "Guille", and the strange is that ( $row[0] == "Guille
") returns false :S

------------------------------------------------------------------------

[2005-08-08 08:57:30] sniper@php.net

Instead of that echo $row[0]; do this:

var_dump($row[0]);


------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/34030

-- 
Edit this bug report at http://bugs.php.net/?id=34030&edit=1


Thread (9 messages)

« previous php.bugs (#83260) next »