2

I've run into some trouble writing a hook_update_N function that will remove a row from the system table. Can anyone point me in the right direction? Finding little documentation..

3

I think your code should look something like this:

<?php

/**
 * Delete row from system table.
 */
function MODULENAME_update_7001() {
  db_query('DELETE FROM {system} WHERE name = :name', array(':name' => 'FOO'));
}

This should go in the MODULENAME.install file of your module. Of course you'll need to replace MODULENAME with the name of your module and FOO with the name of the row you want to delete.

Relevant documentation can be found at Updating tables: hook_update_N() functions, hook_update_N and Database abstraction layer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.