By ClementC on
Hello,
My module creates a new content type and I use Schema API to build the DB tables. My problem is the following : one node creation form must filled two tables instead of one as usual.
So the code :
function my_module_insert($node) {
drupal_write_record('my_table', $node);
}
is not sufficient.
I need something like :
function my_module_insert($node) {
drupal_write_record('my_first_table', $node_first_part);
/* get the id of the row just inserted (am I forced to use a SQL request for that ?) */
drupal_write_record('my_second_table', $node_second_part);
}
Perhaps I must split this content type in two. But can I use one form to build two nodes ?
I have no idea how can I do that stuff. Is it possible ? What is the best way ?
Regards.