Doc #9898 [NEW]: Example 34-3 has unused variable
| From: | graeme at ijws dot com | Date: | Sun, 21 Jan 2007 17:07:59 +0000 |
| Subject: | Doc #9898 [NEW]: Example 34-3 has unused variable | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-9333@lists.php.net to get a copy of this message | ||
From: graeme at ijws dot com
Operating system:
Package version:
PHP version: Irrelevant
Package: Documentation
Bug Type: Documentation Problem
Bug description: Example 34-3 has unused variable
Description:
------------
"Example 34-3. Passing an array to execute()" in online documentation as
of 2007-01-21 has reference to an unused variable "$types" which may
confuse people:
// Current documentation:
// Once you have a valid MDB2 object named $mdb2...
$types = array('integer', 'text', 'text');
$sth = $mdb2->prepare('INSERT INTO numbers VALUES (:id, :text, :lang)');
$data = array('id' => 1, 'name' => 'one', 'lang' =>
'en');
$affectedRows = $sth->execute($data);
Test script:
---------------
// Expected documentation:
// Once you have a valid MDB2 object named $mdb2...
$sth = $mdb2->prepare('INSERT INTO numbers VALUES (:id, :text, :lang)');
$data = array('id' => 1, 'name' => 'one', 'lang' =>
'en');
$affectedRows = $sth->execute($data);
Expected result:
----------------
// Could show $types in a comment to let the reader know what they are.
--
Edit bug report at http://pear.php.net/bugs/bug.php?id=9898&edit=1
--