$node object not populating with data I'm using the Rules module to execute custom PHP script whenever a new node is saved after importing via Feeds module. 

&lt;?php

$lid = db_insert('location')-&gt;fields(array(
    'additional' =&gt; $node-&gt;field-address, //saves as '0'
    'city' =&gt; $node-&gt;field-locality, // saves '0'
    'province' =&gt; $prov, // //saves correctly
    'country' =&gt; 'xx', //saves 'xx' correctly
    'latitude' =&gt; $node-&gt;field-latitude-temp, //saves as 0.00000
    'longitude' =&gt; $node-&gt;field-longitude-temp, //same
    'source' =&gt; 1,
    'is_primary' =&gt; 0
))-&gt;execute();


This is the location table (from the Location module) and I'm importing data from a csv file.

All the other constant values are saved properly except for when it is coming from the $node object. Lat and Lon goes 0.00000 while all the other string values such as city and address also goes 0. 

Been dealing with this for hours. 

EDIT: I'm using Feeds module. But I need to import also location data. While a row is getting committed to db, the values are all 0!

node:field-latitude-temp shows the actual imported value correctly when viewing the node. But it is not getting absorbed in within the PHP Execute custom code page in Rules.
I am not sure this can help you, but I don't think $node-&gt;field-address or $node-&gt;field-longitude-temp are valid syntax by $node object, you should use $node-&gt;field_address['und'][0]['value'] or with entity_metadata_wrapper function, eg:

$nodeWrapper = entity_metadata_wrapper('node', $node);
$nodeWrapper-&gt;field_address-&gt;value()