prickett wrote:
>
> I'm trying to insert a record into a MySql table that has no key. I'm
> using an adapter and the following code:
>
> Zend_Registry::get( "dbAdapter" )->insert( "USERS" , array( "username" =>
> $this->username , "password" => $this->password ) );
>
>
> This, however, results in a key violation.
>
> I see that when you do an insert from a table object (instead of from an
> adapter) you have the ability to say there is no key:
>
> class BugStatus extends Zend_Db_Table_Abstract{
> protected $_sequence = false;
> }
>
> Is there a way to do this via the adapter too?
>
> TIA
>
Can you give us more details? "results in a key violation", what is the
exception?
The insert() method on Zend_Db_Adapter_Abstract does nothing with primary
keys, as far as I know. It simple users the fields you provide and inserts
them as they are. I suspect there's something else going on.
--
View this message in context:
http://www.nabble.com/Insert-using-Zend-DB-and-an-adapter-tp22085792p22108723.html
Sent from the Zend Framework mailing list archive at Nabble.com.