Re: Re: [RFC] deprecate PDO::PARAM_NULL
| From: | Marco Pivetta | Date: | Thu, 18 May 2017 09:43:42 +0000 |
| Subject: | Re: Re: [RFC] deprecate PDO::PARAM_NULL | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-99099@lists.php.net to get a copy of this message | ||
On Thu, May 18, 2017 at 11:38 AM, Lester Caine <lester@lsces.co.uk> wrote:
> On 18/05/17 09:15, Dorin Marcoci wrote:
> > Yes, null is a state, not a type. ->bindValue('Foo', PDO::PARAM_NULL) is
> > awesome.
> > So it should be deprecated and removed.
>
> ? One of the reasons for using 'prepare' is to set up a query which can
> be run several times and some of those passes may require that one of
> the parameters IS null. Easy enough with the array passed to Execute,
> but more difficult if you have used the PDO parameter handling. In my
> book being able to flag a parameter as 'NULL' for a pass is just as
> important as supplying a value, so while yes NULL is a state, it is also
> a valid value for a parameter.
>
You can bind
NULL pretty much with any PDO type - PDO::PARAM_NULL is not
needed to do so.
Marco Pivetta
http://twitter.com/Ocramius
http://ocramius.github.com/