I have created a table by using hook_update_N() function. After creation, if i am trying to insert data into table but it is not storing. Is there any thing else is there to do after creating table by using hook_update_N()..?
If you're using
drupal_write_record, be aware of this warning in the documentation
Do not use
hook_update_N()functions, since the database schema cannot be relied upon when a user is running a series of updates. Instead, use
db_update()to save the record.
You should be using
You can not use
node_save() inside the
hook_update_N() function. You must first create the schema for your new table by running the update script. After having run the update script, use a DB manager such as phpMyAdmin to check that it has been created in the database.
Then, to use the schema, the
node_save() function must to be called from your custom module, not from inside