I want to add company details in a node from an external database. How do I put more data in a node body?
// Set the external database as the active one.
db_set_active('db_wirdfit');
// Retrieve data from the external database.
$result = db_query('SELECT * FROM wirdfit.wirdfit_data');
// Set the active database to the default one.
db_set_active();
foreach ($result as $row) {
$node->type = "page";
$node->title = $row->id;
// node_object_prepare($node); // Set some default values.
$node->body(LANGUAGE_NONE)(0)('value') = $row->post_title;
$node->body(LANGUAGE_NONE)(0)('summary') = text_summary($row->post_title);
$node->body(LANGUAGE_NONE)(0)('format') = 'full_html';
I will add other data from the external database into the node body.
Can anybody help?