I had created content type content_type_mmj_story.
I have to save all the data from my page-story.tpl.php
i used the function node_save($node); and content_insert($node); but it only inserts into 'node' table and not in
content_type_mmj_story table with respective values.

can any one plz help me about how to save my custom content.

Comments

zeal’s picture

You can use hook_nodeapi() as follows:

function hook_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
  switch($op) {
     case 'insert':
       if ($node->type == "<your node type>") {
          //write your code here that insert data in the table you want.
       }
       break;
  }
}

Also, please share your experience, if you can solve this other way.

:)

beautifulmind’s picture

This solved my problem.

Thanks Zeal

:)

Beautifulmind
Know more

Regards.
🪷 Beautifulmind