node_load is returning the wrong value


               $property = node_load($property_id, NULL, TRUE);
		echo $property_id; 
		print_r($property);
		
		
		$result = db_query('SELECT * FROM field_data_field_status where entity_id = ' . $property_id);
			
			foreach($result as $item) {			
				echo $item->field_status_value;
							
			}

$property_id is holding the correct Id number

field_status as part of print_r($property); contains published which is incorrect

echo $item->field_status_value; says paused which is correct

Any ideas why node_load is picking up an incorrect value for field_status please?

Thanks

Comments

info@knutsford-software.co.uk’s picture

I was using db_update to store the value in field_status_value Once I changed it to

$property = node_load($nid);
$property->field_status[$property->language][0]['value'] = 'paused';
node_save($property);

node_load picked up the correct value - phew