1 dbtng_example.module dbtng_example_entry_delete($entry)

Delete an entry from the database.

The usage of db_query is deprecated except for static queries. Formerly, a deletion might have been accomplished like this:

<?php
 db_query("DELETE FROM {dbtng_example} WHERE pid = %d", $entry['pid]);
?>

Parameters

array $entry: An array containing at least the person identifier 'pid' element of the entry to delete.

See also

db_delete()

Related topics

File

modules/examples/dbtng_example/dbtng_example.module, line 158
This is an example outlining how a module can make use of the DBTNG database API in Backdrop.

Code

function dbtng_example_entry_delete($entry) {
  db_delete('dbtng_example')
    ->condition('pid', $entry['pid'])
    ->execute();

}