#34030 [Opn->Fbk]: a pg_fetch_row result doesnt make string comparisons
| From: | sniper@php.net | Date: | Tue, 09 Aug 2005 08:17:44 +0000 |
| Subject: | #34030 [Opn->Fbk]: a pg_fetch_row result doesnt make string comparisons | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-83227@lists.php.net to get a copy of this message | ||
ID: 34030
Updated by: sniper@php.net
Reported By: mansilla_g at yahoo dot com
-Status: Open
+Status: Feedback
Bug Type: PostgreSQL related
Operating System: linux
PHP Version: 4.3.11
New Comment:
As you see, it's 50 chars long? What type of column is that..? Have you
heard about trim() ? :)
Previous Comments:
------------------------------------------------------------------------
[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]);
------------------------------------------------------------------------
[2005-08-08 04:26:22] mansilla_g at yahoo dot com
i forgot, using "===" doenst work either
but the most interesting if that you compare numbers it works, for
example, lets suppose $Row[1] = 34030 then you compare, if ( $Row[1]
== 34030) , it returns true :S
------------------------------------------------------------------------
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