->insert()

->insert() – Insert current objects variables into database

Synopsis

mixed $DB_DataObject->insert (
)

Description

Insert the data into the database, based on the variable values of the current object and returns the ID
of the inserted element if sequences or primary keys are being used. The values are correctly quoted,
and some limited type checking is done.

With mysql, the mysql_next_id() method is used, on other databases, PEAR DB sequence method is
used.

Note, insert() may not return the ID correctly in quite a few situations:

If the database backend does not support it.

The generator did not correctly flag the correct column as autoincrement/nextval

I spent at least 3 days to find out why there is extra table with additional "_seq" in my database. I finally realize it is created because sequenceKey(). I don't know why bother to find sequenceKey() if my table is no need sequence key? This feature should not set by flag or option, otherwise I have to manually add in return array(false, false) each time after if package upgrade?