Bug #5383 [Opn->Csd]: Misleading docs for DataObject->query()?
| From: | arnaud@php.net | Date: | Thu, 22 Sep 2005 07:59:40 +0000 |
| Subject: | Bug #5383 [Opn->Csd]: Misleading docs for DataObject->query()? | ||
| References: | 1 | Groups: | php.pear.doc |
| Request: | Send a blank email to pear-doc+get-6870@lists.php.net to get a copy of this message | ||
Edit report at http://pear.php.net/bugs/bug.php?id=5383&edit=1
ID: 5383
Updated by: arnaud@php.net
Reported By: pear at bluefish dot co dot uk
-Status: Open
+Status: Closed
Id: 5383
Type: Bug
Package: Documentation
Operating System: win 2k sp4
PHP Version: 5.1.0 RC1
New Comment:
This bug has been fixed in CVS.
If this was a documentation problem, the fix will appear on
pear.php.net by the end of next Sunday (CET).
If this was a problem with the pear.php.net website, the change should
be live shortly.
Otherwise, the fix will appear in the package's next release.
Thank you for the report and for helping us make PEAR better.
Previous Comments:
------------------------------------------------------------------------
[2005-09-13 09:07:49] pear at bluefish dot co dot uk
Changed summary to be more specific
------------------------------------------------------------------------
[2005-09-13 09:04:46] pear at bluefish dot co dot uk
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 this bug report at http://pear.php.net/bugs/bug.php?id=5383&edit=1