PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Database » DB_QueryTool » Bug #954

Can't set primary key with add()

Details

Submitted2004-03-06 04:53 UTC
Fromieure at php dot net
Assignedquipo
StatusClosed
PackageDB_QueryTool
PHP VersionIrrelevant
OSDebian GNU/Linux
Roadmaps(Not assigned)

Comments

[2004-03-06 04:53 UTC] ieure at php dot net

Description:
------------
Calling add() unsets any primary key in the row passed to it. This is
bad because it prevents one from, e.g. importing a 3rd-party
database.

Reproduce code:
---------------
$data = array(
'id' => 42,
'name' => 'the answer'
)
$table->add($data);

Expected result:
----------------
A record with an id of '42' should be created.

Actual result:
--------------
A record with the next available id is created.