function chado_query_range

1.x tripal_core_chado.api.inc chado_query_range($query)

Use this function instead of db_query_range().

@returns A database query result resource or FALSE if the query was not executed correctly

Parameters

$sql: The SQL statement to execute, this is followed by a variable number of args used as substitution values in the SQL statement.

$from: The first result row to return..

$count: The maximum number of result rows to return.

Related topics

1 call to chado_query_range()
chado_pager_query in tripal_core/api/tripal_core_chado.api.inc
Use this function instead of pager_query() when selecting a subset of records from a Chado table.

File

tripal_core/api/tripal_core_chado.api.inc, line 2407
The Tripal Core API

Code

function chado_query_range($query) {
  $args = func_get_args();
  $count = array_pop($args);
  $from = array_pop($args);
  array_shift($args);


  if (isset($args[0]) and is_array($args[0])) { // 'All arguments in one array' syntax
    $args = $args[0];
  }
  $query .= ' LIMIT ' . (int) $count . ' OFFSET ' . (int) $from;

  return chado_query($query, $args);
}