You are here

function closeblock_closing_info_get_db in Close Block 6

Load the saved information from the db.

1 call to closeblock_closing_info_get_db()
closeblock_closing_info_get in includes/closeblock.api.inc
Get info.

File

model/closeblock.db.inc, line 6

Code

function closeblock_closing_info_get_db($params) {
  $blocks = array();
  $where = array();
  if (empty($params)) {
    $params = array(
      1,
    );
    $where[] = '%d';
  }
  else {
    foreach ($params as $param => $value) {
      $where[] = $param . ' = ' . (is_numeric($value) ? '%d' : "'%s'");
    }
  }
  $query = 'SELECT * FROM {closeblock} WHERE ' . implode(' AND ', $where);
  $result = db_query($query, $params);
  while ($block = db_fetch_object($result)) {
    $blocks[] = $block;
  }
  return $blocks;
}