->insert()

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

Synopsis

mixed $DB_DataObject->insert ()

Описание

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:

Возвращаемое значение

mixed - Id or key

Throws

Таблица 34-1. Возможные значения PEAR_Error

Error codeError messageMeaningSolution
DB_DATAOBJECT_ERROR_INVALIDCONFIG"insert:No table definition for $table"  
DB_DATAOBJECT_ERROR_NODATA"insert: No Data specifed for query"  
DB_**see PEAR::DBsee PEAR::DB

Заметка

Эта функция не должна вызываться статически.

Пример


HIVE: All information for read only. Please respect copyright!
Hosted by hive йца: йХЕБЯЙЮЪ ЦНПНДЯЙЮЪ АХАКХНРЕЙЮ