PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Database » DB_DataObject » Bug #2659

Use of primary keys on update/delete

Details

Submitted2004-11-01 13:50 UTC
Frommorten at vianett dot no
StatusSuspended
PackageDB_DataObject
PHP Version4.3.9
OSXP
Roadmaps(Not assigned)

Comments

[2004-11-01 13:50 UTC] morten at vianett dot no

Description:
------------
id is not auto increment in test1 so this query is not right. Here it will update records for id 1 on all systems when I want to update id 1 and systemId 5.

Reproduce code:
---------------
$a = new dbo_Test1();
$a->debuglevel(1);
$a->id = 1;
$a->systemId = 5;
$a->name = 'test1';
$a->update();

Expected result:
----------------
<code><B>dbo_test1: 3:</B> got keys as a:1:{i:0;s:2:"id";}</code><BR>
<code><B>dbo_test1: QUERY:</B> UPDATE test1 SET systemId = 5 , name = 'test1' WHERE test1.id = 1 AND test1.systemId = 5 </code><BR>
<code><B>dbo_test1: query:</B> QUERY DONE IN 0.0010359287262 seconds</code><BR>

Actual result:
--------------
<code><B>dbo_test1: 3:</B> got keys as a:1:{i:0;s:2:"id";}</code><BR>
<code><B>dbo_test1: QUERY:</B> UPDATE test1 SET systemId = 5 , name = 'test1' WHERE test1.id = 1 </code><BR>
<code><B>dbo_test1: query:</B> QUERY DONE IN 0.0010359287262 seconds</code><BR>