For Programmers: Free Programming Magazines  


Home > Archive > PHP Documentation > May 2006 > #37290 [Opn->Csd]: Doesn't say how indexes of input array are interpreted









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author #37290 [Opn->Csd]: Doesn't say how indexes of input array are interpreted
dbs@php.net

2006-05-03, 6:59 pm

ID: 37290
Updated by: dbs@php.net
Reported By: spam01 at pornel dot net
-Status: Open
+Status: Closed
Bug Type: Documentation problem
Operating System: *
PHP Version: Irrelevant
New Comment:

"Example 2. Execute a prepared statement with an array of insert
values" demonstrates how to pass an input array.

Writing about how bindParam takes 1-based indexes for arguments, while
the input array to PDOStatement::execute() takes a 0-based index, is
just going to confuse users. Less is more, and examples rule.


Previous Comments:
------------------------------------------------------------------------

[2006-05-03 12:06:56] spam01 at pornel dot net

Description:
------------
http://php.net/manual/en/function.p...ent-execute.php

PDOStatement::execute() may accept input array with parameters, but
docs doen't specify how this array is used.

This is important, because bindParam oddly expects indexes starting
from 1 and it looks that execute() expects different indexing, starting
from 0.

Also invalid indexes seem to be ignored. Is this intended behavior?




------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=37290&edit=1
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com