# Method Gdbm.DB()->store()

Method store

  `int store(string key, string data)`

Description

  Associate the contents of 'data' with the key 'key'. If the key 'key' already exists in the database the data for that key will be replaced. If it does not exist it will be added. An error will be generated if the database was not open for writing.

Example

      gdbm->store(key, data);

Returns

  Returns `1` on success.

Note

  Note that the returned value differs from that of `[]=().

See also

  `[]=()