DB_DataObject fails matching text primary key field
| From: | Craig Ambrose | Date: | Mon, 02 May 2005 06:59:44 +0000 |
| Subject: | DB_DataObject fails matching text primary key field | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-19033@lists.php.net to get a copy of this message | ||
Hi folks,
I'm having trouble with using DB_DataObject to select a bunch of records when
I set a field on the object which is one of a two field primary key, and is a
text field. For example:
$data_object->my_name_field = 'something';
$data_object->find();
while ($data_object->fetch()) { print_r($data_object); }
The code above returns every row in the table. Whereas, the code below works
as expected, and only returns a few rows:
$data_object->some_other_field = 'something';
$data_object->find();
while ($data_object->fetch()) { print_r($data_object); }
Doing $data_object->whereAdd("my_name_field = 'something'") also works as
expected.
Before anyone asks, yes, I've run the create tables script. :) And yes the
relevent data object class looks up to date.
Also, I know about the PHP 5.0.3 problem, and I've definatelly running v5.0.2
(Gentoo package 5.0.2-r1).
As far as PEAR goes, version are:
PEAR 1.3.5 stable
DB 1.7.6 stable
DB_DataObject 1.7.13 stable
Is this actually an bug, or am I doing something crazy? Thanks for your
thoughts.
regards,
Craig
--
Craig Ambrose
Web Elements
http://www.portallus.com/people/craigambrose/