Report new bug | New search | Development Roadmap Status: Open | Feedback | All

Bug #5383 Misleading docs for DataObject->query()?
Submitted: 2005-09-13 13:04 UTC
From: pear at bluefish dot co dot uk Assigned: arnaud
Status: Closed Package: Documentation
PHP Version: 5.1.0 RC1 OS: win 2k sp4
Roadmaps: (Not assigned)    
Subscription  
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes. If this is not your bug, you can add a comment by following this link. If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
2005-09-22 07:59 UTC
Package:
Bug Type:
Summary:
From: pear at bluefish dot co dot uk
New email:
PHP Version: Package Version: OS:

 

 [2005-09-13 13:04 UTC] 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";}

Comments

 [2005-09-13 13:07 UTC] pear at bluefish dot co dot uk
Changed summary to be more specific
 [2005-09-22 07:59 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!