phpday 2027 - Call for Papers

dba_insert

(PHP 4, PHP 5, PHP 7, PHP 8)

dba_insert — Insert entry

Опис

function dba_insert(string|array $key, string $value, Dba\Connection $dba): bool

dba_insert() inserts the entry described with key and value into the database.

Параметри

key

The key of the entry to be inserted. If this key already exists in the database, this function fails. Use dba_replace() if you need to replace an existing key.

The inifile and cdb_make handlers are the exception: they add another entry with the same key and return true. With inifile, use the skip parameter of dba_fetch() to read it.

value

The value to be inserted.

dba

Примірник Dba\Connection, якого повертає функція dba_open() або dba_popen().

Значення, що повертаються

Повертає true у разі успіху або false в разі помилки.

Помилки/виключення

If dba was opened read-only (mode r), an E_WARNING is raised and false is returned.

Журнал змін

Версія Опис
8.4.0 Тепер параметр dba має бути примірником Dba\Connection. раніше очікувався дійсний dba resource.

Прогляньте також

+add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top