Issue with module's hook_uninstall (not uninstalling db entries) I have a custom Drupal 6 module (based on this issue) that puts some custom date and time formats into the date_format_types table and then can be accessed from /admin/settings/date-time/formats.  This works nicely but I'd like to remove these from that table if the module gets uninstalled. 

In my module's .install file, I tried this code:

&lt;?php

/**
 * Implementation of hook_uninstall().
 */
function eventdates_custom_uninstall() {
  db_query("DELETE FROM {date_format_types} WHERE type LIKE 'eventdates_custom_date_%'");
}


This does not seem to work and the entries that had been added do not get removed from the date_format_types table when I uninstall the module but I am pretty sure I have the query correct.
% is used as the placeholder marker for D6 queries, so you need to escape it with another %:

db_query("DELETE FROM {date_format_types} WHERE type LIKE 'eventdates_custom_date_%%'");


As a test I just added the following to the date_format_types table:



And then ran this query from the devel/php page:

db_query("DELETE FROM {date_format_types} WHERE type LIKE 'eventdates_custom_date_%%'");


And both rows were deleted: