Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7500673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T20:15:46+00:00 2026-05-29T20:15:46+00:00

I am trying to update Node on hook_cron function. I am using Drupal6 Here

  • 0

I am trying to update Node on hook_cron function. I am using Drupal6 Here is my Code

function offers_cron() {
$query= db_query("SELECT * FROM {node} WHERE type = 'product'");
while($allnodes = db_fetch_object($query)){
    $node_id=$allnodes->nid;
    $node=node_load($node_id);
$node = new stdClass();
    $node->nid = $node_id;  
    $node->type = 'product';
    $node->language = 'en';
    $node->uid=1;
    $node->status = 1; 
    $node->created = time();
    $node->changed = $node->created;
    $node->comment=0;
    $node->promote = 0; 
    $node->sticky = 0;  
    $node->format = 2;  
    $node->title='test';
    $node->field_price[0]['value']='120';
    if ($node = node_submit($node)) {
        node_save($node);
          drupal_set_message(t("Node ".$node->title." added correctly"));
    } else {
        drupal_set_message(t("Node ".$node->title." added incorrectly"), "error");
    }


}


}

Now it shows it has updated all nodes here is screen shot for this
enter image description here

Now when i click any node it doesnot show any updation
See here
enter image description here

Any Body have Idea About this

By it occurs Problem. I even Clear Cache

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T20:15:47+00:00Added an answer on May 29, 2026 at 8:15 pm

    If node doesn’t change, don’t create new revision

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to update an NText field in SQL 2000 using Classic ASP. Here
I'm trying to do an insert or update in a postgres database using node.js
I am trying to update a child node of an XML file IE Changing
I am trying to update a field in a table with data from another
So I'm trying to update an object in my MS SQL 2005 database using
I am trying to update a field of type spFieldUserValue, you know a, PeoplePicker.
I'm trying to make a simple custom field field_book_year for the new node type
I am trying to update the content of PrimeFaces <p:layoutUnit> on <p:tree> node selection.
I'm trying to create a node form for a custom type. I have organic
I'm trying to code what I think is a fairly routine AJAX pattern using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.