You are here

function counter_update_6002 in Counter 6.2

1 call to counter_update_6002()
counter_install in ./counter.install
Install the module with a new database table @file

File

./counter.install, line 192
Install the module with a new database table

Code

function counter_update_6002() {
  $ret = array();

  //blocked_user
  $sql = " SELECT count(*) as total FROM {users} WHERE status=0 and uid<>0";
  $data = db_fetch_object(db_query($sql));
  $counter_total = $data->total;
  $sql = " SELECT count(*) as total FROM {counter_data} WHERE counter_name= 'blocked_user' ";
  $counter_data = db_fetch_object(db_query($sql));
  $counter_name_exist = $counter_data->total;
  if (!$counter_name_exist) {
    $sql = " INSERT INTO {counter_data} (counter_name,counter_value) VALUES ('%s','%s')";
    $results = db_query($sql, "blocked_user", $counter_total);
  }
}