db_query creates three entries in database

bfr - November 4, 2009 - 11:48
Project:Computed Field
Version:6.x-1.0-beta3
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

I'm not sure if this is computed fields fault, but i have following in the computed field:

$prosentit=$node->field_percentage_in_month[0]['value'];
$kuukausi=$node->field_resurssit_months[0]['value'];
$kayttaja=$node->field_resurssit_user[0]['uid'];
$projekti=$node->field_create_project[0]['nid'];
$arr = array( $node->field_resurssit_months[0]['value'] => $node->field_percentage_in_month[0]['value'] );

$savetodb=serialize($arr);

$result = db_query("INSERT INTO `fgidatabase`. `project_data` (`auto_inc`,`uid` ,`pid` ,`data`) VALUES (NULL , '$kayttaja', '$projekti', '$savetodb');");

Now everytime the node is created or edited, instead of one, three separate entries are created in to database, all with the same data(except the auto_inc field ofcourse). Any clue why this is happening? Is the computed field "ran" three times?

 
 

Drupal is a registered trademark of Dries Buytaert.