ID: 49256 Updated by: [email protected] Reported By: rafinguer at gmail dot com -Status: Open +Status: Bogus Bug Type: PostgreSQL related Operating System: Windows Vista PHP Version: 5.2SVN-2009-08-14 (snap) New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. Previous Comments: ------------------------------------------------------------------------ [2009-08-16 06:05:05] selotsom at hotmail dot com I use postgre and php, and I have not any problem. I also use logical deletions with a boolean field, and it works well. Please, send me your code and the database model at [email protected] ------------------------------------------------------------------------ [2009-08-15 09:30:33] rafinguer at yahoo dot es I'm sorry. The code is not correct. The code is the next following: $result=""; $qry = "select id_product_type, name_product_type ". "from sch_trazalogic.product_type ". "where deleted=false ". "order by name_product_type"; $result_qry = pg_query($connection, $qry); $num_rows = pg_numrows($result_qry); $current=0; while ($current<$num_rows) { $row = pg_fetch_row($result_qry, $current); // fetch current row $result = $result.$row[0]."-".$row[1]."\n"; $current++; } pg_close($connection); echo $result; Apache version is 2.2 ------------------------------------------------------------------------ [2009-08-15 09:25:55] rafinguer at yahoo dot es I forgot to mention that the version of PostgreSQL is 8.3 ------------------------------------------------------------------------ [2009-08-14 16:07:01] rafinguer at gmail dot com Description: ------------ PHP ignores the true or false values in a SQL sentence, returning always all the records: select id_product_type, name_product_type from sch_trazalogic.product_type where deleted=false order by name_product_type I tried with "where deleted='f'" and with "where not deleted". The result is the same. With PGAdmin (Query tool), the result is correct. Reproduce code: --------------- $result=""; $qry = "select id_product_type, name_product_type ". "from sch_trazalogic.product_type ". "where deleted=false ". "order by name_product_type"; $result_qry = pg_query($connection, $qry); $num_rows = pg_numrows($result_qry); $current=0; while ($current<$num_rows) { $row = pg_fetch_row($result_qry, $current); // fetch current row $result = $result_xml.$row[0]."-".$row[1]."\n"; $current++; } pg_close($connection); echo $result_xml; Expected result: ---------------- All the records with "deleted" with "false" value Actual result: -------------- All the records (deleted=true and deleted=false) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=49256&edit=1
