Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99052 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 61979 invoked from network); 15 May 2017 16:22:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 May 2017 16:22:10 -0000 Authentication-Results: pb1.pair.com smtp.mail=dorin.marcoci@marcodor.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dorin.marcoci@marcodor.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain marcodor.com designates 93.115.138.71 as permitted sender) X-PHP-List-Original-Sender: dorin.marcoci@marcodor.com X-Host-Fingerprint: 93.115.138.71 mail.marcodor.com Received: from [93.115.138.71] ([93.115.138.71:42421] helo=mail.marcodor.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 79/1E-15531-FA5D9195 for ; Mon, 15 May 2017 12:22:09 -0400 Received: from DESKTOP9R8I199 (host-static-93-115-138-66.moldtelecom.md [93.115.138.66]) by mail.marcodor.com (Postfix) with ESMTPSA id 754706C41AF for ; Mon, 15 May 2017 19:22:04 +0300 (EEST) To: Date: Mon, 15 May 2017 19:22:04 +0300 Organization: Marcodor Message-ID: <002801d2cd97$63921700$2ab64500$@marcodor.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0029_01D2CDB0.88DFEB40" X-Mailer: Microsoft Outlook 16.0 Thread-Index: AdLNlZ/Hv1aL+ZMrTFSOaNUgedkExA== Content-Language: ro DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marcodor.com; s=dkim; t=1494865324; h=from:subject:date:message-id:to:mime-version:content-type; bh=0wC7lDlMWGF2Lgb8O6C++8f++NcEInUdhz5jQsBLE18=; b=qzjUCcca+AvObU165r4khCNPJZ48phvSay3mWb3VvHEYgzqDxN9DCppmEuFtzKoyCZFHIp gsZJnbeXGKnz/iO/PHNQcL5mrO793r1UNeKf2HmEZFoonpEALYZtlN72N37HI6DGU7AXRT SjBmulLZa4apYs7de81h3WwsOV2ysHRnv+AgH7hu+dVGfGFm3MHFV7pXMMZ4eWUjOVjCBZ coL1Z6FeDWPD7ijGPByp4v/m07ZDYTnuISvPsKEFlMkovxRw1hp/gtMxukQ9jJOLZSGXOX 3qK8RtX/7dNklMDg261vsbDOtpI4LvSo9b21+0LrlAHm/1uPj1If3ESHrJk4pg== Subject: PDO Parameter types // PDO::PARAM_AUTO From: dorin.marcoci@marcodor.com ("Dorin Marcoci") ------=_NextPart_000_0029_01D2CDB0.88DFEB40 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hello Everyone! Currently PDOStatement::bindValue is declared as public bool PDOStatement::bindValue ( mixed $parameter , mixed $value [, int $data_type = PDO::PARAM_STR ] ) where third parameter is data type, string type as default. It may be useful in terms of providing meta info and handle it accordingly, like quote, cast or do some additional stuff. But there are DBMSes where this "feature" is more a burden than a helper. It's because after PDO::prepare, driver and server already knows all statement parameters and expected types. Yes, it can be "forced", saying to pass for a integer parameter a string value, server will convert it to required type. It is convenient in most cases to pass them as strings, for example by simply assign all params in a cycle before execute. But when implementing FB Boolean data type parameters and doing ->bindValue ('bool_param', false) I get an empty string internally. Yes, true ZVAL is converted as string as '1', but false as an empty string, not so consistent here ;) That's why I think, it will be great to have a special type like PDO::PARAM_AUTO and a config flag to set it as default instead of PARAM_STR. Any thoughts? - Dorin ------=_NextPart_000_0029_01D2CDB0.88DFEB40--