You are here

function DB_mysql::modifyLimitQuery in Flickr API 5

Adds LIMIT clauses to a query string according to current DBMS standards

@access protected

Parameters

string $query the query to modify:

int $from the row to start to fetching (0 = the first row):

int $count the numbers of rows to fetch:

mixed $params array, string or numeric data to be used in: execution of the statement. Quantity of items passed must match quantity of placeholders in query: meaning 1 placeholder for non-array parameters or 1 placeholder per array element.

Return value

string the query string with LIMIT clauses added

Overrides DB_common::modifyLimitQuery

File

phpFlickr/PEAR/DB/mysql.php, line 852

Class

DB_mysql
The methods PEAR DB uses to interact with PHP's mysql extension for interacting with MySQL databases

Code

function modifyLimitQuery($query, $from, $count, $params = array()) {
  if (DB::isManip($query)) {
    return $query . " LIMIT {$count}";
  }
  else {
    return $query . " LIMIT {$from}, {$count}";
  }
}