note 78072 added to function.pg-query-params

From: Date: Wed, 26 Sep 2007 22:57:31 +0000
Subject: note 78072 added to function.pg-query-params
Groups: php.notes 
Request: Send a blank email to php-notes+get-130813@lists.php.net to get a copy of this message
When inserting into a pg column of type bool, you cannot supply a PHP type of bool. You must instead use a string "t" or "f". PHP attempts to change boolean values supplied as parameters to strings, and then attempts to use a blank string for false. Example of Failure: pg_query_params('insert into table1 (bool_column) values ($1)', array(false)); Works: pg_query_params('insert into lookup_permissions (system) values ($1)', array(false ? 't' : 'f')); ---- Server IP: 64.71.164.2 Probable Submitter: 216.145.226.130 ---- Manual Page -- http://www.php.net/manual/en/function.pg-query-params.php Edit -- https://master.php.net/note/edit/78072 Del: integrated -- https://master.php.net/note/delete/78072/integrated Del: useless -- https://master.php.net/note/delete/78072/useless Del: bad code -- https://master.php.net/note/delete/78072/bad+code Del: spam -- https://master.php.net/note/delete/78072/spam Del: non-english -- https://master.php.net/note/delete/78072/non-english Del: in docs -- https://master.php.net/note/delete/78072/in+docs Del: other reasons-- https://master.php.net/note/delete/78072 Reject -- https://master.php.net/note/reject/78072 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#130813) next »