DataObjects insert question
| From: | Ed Greenberg | Date: | Sat, 15 Jan 2005 15:18:50 +0000 |
| Subject: | DataObjects insert question | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-16943@lists.php.net to get a copy of this message | ||
I have a table:
CREATE TABLE
classified_detail (
item_id int(10) unsigned NOT NULL default '0',
price_min decimal(10,0) NOT NULL default '0',
price_max decimal(10,0) default NULL,
PRIMARY KEY (item_id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
createTables defines it as:
[classified_detail]
item_id = 129
price_min = 129
price_max = 1
[classified_detail__keys]
item_id = K
When I do an insert:
$detail=DB_DataObjects::factory('classified_detail');
$detail->item_id = 20;
$detail->insert();
I get:
DB Error: unknown errordb_error Object
(
[error_message_prefix] =>
[mode] => 16
[level] => 1024
[code] => -1
[message] => DB Error: unknown error
[userinfo] => CREATE TABLE classified_detail_seq (id INTEGER UNSIGNED AUTO_INCREMENT NOT NULL, PRIMARY KEY(id))
[nativecode=1044 ** Access denied for user 'valleylists'@'localhost' to database 'dev']
This table is supposed to have a manually set primary key.
I have other tables that ARE autoincrementing primary keys and those work fine.
the __keys stanza for the autoincrementing keys are "item_id = N"
What is going on?
</edg>