Hi, I'm trying to update a CCK fields value from my node.tpl.
The value updates in the database but it seems Drupal is reading from a cached value somewhere?

Here's my query. What am I missing?

db_query("UPDATE {content_type_photo} SET field_CCKnumber_value = 10 WHERE nid = 1");
(I've hardcoded numbers 10 and 1 to test this code but they will eventually be passed in dynamically.)

Many thanks

Comments

cog.rusty’s picture

In node.tpl.php? Probably the template variable which you are printing ($content or whatever) has already taken its value.

pobster’s picture

cache_content?

Try using;

cache_clear_all('content:1:1', 'cache_content');

I think the 1:1 is nid:vid?

Pobster

fiasst-1’s picture

thanks :]