You are here

closeblock.db.inc in Close Block 6

Same filename and directory in other branches
  1. 7 model/closeblock.db.inc

File

model/closeblock.db.inc
View source
<?php

/**
 * Load the saved information from the db.
 */
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;
}

Functions

Namesort descending Description
closeblock_closing_info_get_db Load the saved information from the db.