Hi all. I have a content type with a cck integer field and I need to increment it when user click on a link (user is redirect to another page, or similar).
To do this I have two option: 1) node_save 2) db_query
This node type has a total of 5 cck fields. Other fields does not change when user click on that link. My site would be a trafficated site so I could have 10 or 100 clicks on that link in a single moment.
I think to this code (for sql query solution):
db_query("LOCK TABLES {content_type_gf_product} WRITE,{watchdog} WRITE"); db_query("UPDATE {content_type_my_type} set field_download_stats_value = field_download_stats_value+1 where nid = %d and vid = %d", $node->nid,$node->vid); db_query("UNLOCK TABLES");
Tnx.