[eluser]Evil Wizard[/eluser]
it sounds like the parser is expecting a multi dimensional array in candidates and on getting a single dimension array, e.g.
Code:
$candidates = array(
array(
'id' => 1,
'pid' => 12,
'code' => 'unique',
'latitude' => '10.45',
'longitude' => '14.56',
'isactive' => '0'
),
array(
'id' => 2,
'pid' => 16,
'code' => 'unique',
'latitude' => '16.47',
'longitude' => '7.98',
'isactive' => '1'
)
);
$candidates = array(
'id' => 1,
'pid' => 12,
'code' => 'unique',
'latitude' => '10.45',
'longitude' => '14.56',
'isactive' => '0'
);
could it be that when you add the record, it only returns the last inserted record and not the full collection, but you said that when you do a print_r($candidates) its the right array contents, have you done the print_r immediately after the insert?
sorry about the double post, the code snippet gave me trouble with unescaped quotes.