1 database_example.module | database_example_entry_delete($entry) |
Deletes 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 {database_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
Related topics
File
- modules/
examples/ database_example/ database_example.module, line 148 - Hook implementations for the Database Example module.
Code
function database_example_entry_delete($entry) {
db_delete('database_example')
->condition('pid', $entry['pid'])
->execute();
}