Bug #5383 [NEW]: Misleading docs?
| From: | pear at bluefish dot co dot uk | Date: | Tue, 13 Sep 2005 13:04:46 +0000 |
| Subject: | Bug #5383 [NEW]: Misleading docs? | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-6803@lists.php.net to get a copy of this message | ||
From: pear at bluefish dot co dot uk
Operating system: win 2k sp4
PHP version: 5.1.0
Package: Documentation
Bug Type: Bug
Bug description: Misleading docs?
Description:
------------
http://pear.php.net/manual/en/package.database.db-dataobject.db-dataobject.query.php
says you should do a find() after a query()
After eventually realising that no matter what the query was that it was
returning everything, I removed the find() and it worked.
Is this a problem with the docs or with query()/find()?
Test script:
---------------
$speaker = new DBO_Speaker;
$speaker->query("
SELECT * FROM speaker WHERE id=23
");
$speaker->find();
$array = array();
while ($speaker->fetch()) {
$array[] = clone($speaker);
}
return $array;
Expected result:
----------------
finds nothing
Actual result:
--------------
DBO_Speaker: QUERY: SELECT * FROM speaker WHERE id=23
DBO_Speaker: query: QUERY DONE IN 0.00082302093505859 seconds
DBO_Speaker: __find:
DBO_Speaker: QUERY: SELECT * FROM speaker
DBO_Speaker: query: QUERY DONE IN 0.00066304206848145 seconds
DBO_Speaker: __find: CHECK autofetchd
DBO_Speaker: __find: DONE
DBO_Speaker: FETCH:
a:5:{s:2:"id";s:1:"1";s:5:"title";s:2:"Mr";s:9:"firstname";s:6:"Shimon";s:10:"middlename";s:11:"Marc
Joseph";s:7:"surname";s:5:"Young";}
--
Edit bug report at http://pear.php.net/bugs/bug.php?id=5383&edit=1
--