Why do I get Call to undefined function updatedb() I am attempting to wrap my head around some of the advance features of drush.  i am using Drush User's Guide and it's example code and ran into this error [Fatal error: Call to undefined function updatedb() in /home/trakz/.drush/user_blocker.drush.inc on line 68]from the code below. 

Line 68 is: [$query= updatedb('users')] 

Can anyone tell me what is wrong?  I have checked the Drush guide and updatedb() is valid.  Googling around did not help.

drupal 6.28
drush 5.7

any assistance woudl be greatly appreciated.  Thank you.

/**
 * Callback implementation for user-blocker command
 */
function drush_user_blocker() {
  // Grab all languages given. If any.
  $languages = func_get_args();

  // See if we received a date from which we should filter
  $since = strtotime(drush_get_option('since', '2 years ago')); 

  // Perform the update over the users table
  $query= updatedb('users')
  -&gt;fields(array('status' =&gt; 0,))
  -&gt;condition('uid', array(0, 1), 'NOT IN')
  -&gt;condition('access', array(1, $since), 'BETWEEN');

  // Add the condition to filter by language
  if (count($languages)) {
    $query-&gt;condition('language', $languages, 'IN');
  } 

  $total_blocked = $query-&gt;execute();
  drush_log(dt("Blocked !total_blocked users", array('!total_blocked' =&gt; $total_blocked)), 'success');
}
drush updatedb is a valid command.

updatedb (updb)       Apply any database updates required (as with running update.php).


However, I'm not sure about using it in place of db_query.

In D7 you would use db_update there.

In D6, you're stuck with db_query

It looks like a syntax error in the module code, it probably needs to use D6 style db_query