|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-08-08 04:26 UTC] mansilla_g at yahoo dot com
[2005-08-08 08:57 UTC] sniper@php.net
[2005-08-09 01:04 UTC] mansilla_g at yahoo dot com
[2005-08-09 09:10 UTC] sniper@php.net
[2005-08-09 09:36 UTC] mansilla_g at yahoo dot com
[2005-08-09 10:17 UTC] sniper@php.net
[2005-08-09 21:05 UTC] mansilla_g at yahoo dot com
[2005-08-09 21:16 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 14:00:01 2025 UTC |
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