Home » Database » DB_DataObject » Bug #2659
Use of primary keys on update/delete
Details
| Submitted | 2004-11-01 13:50 UTC |
|---|---|
| From | morten at vianett dot no |
| Status | Suspended |
| Package | DB_DataObject |
| PHP Version | 4.3.9 |
| OS | XP |
| 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>