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  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 42 - 37 = ?

 
 [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!