You are here

function DB_common::executeMultiple in Flickr API 5

Performs several execute() calls on the same statement handle

$data must be an array indexed numerically from 0, one execute call is done for every "row" in the array.

If an error occurs during execute(), executeMultiple() does not execute the unfinished rows, but rather returns that error.

Parameters

resource $stmt query handle from prepare():

array $data numeric array containing the: data to insert into the query

Return value

int DB_OK on success. A DB_Error object on failure.

See also

DB_common::prepare(), DB_common::execute()

File

phpFlickr/PEAR/DB/common.php, line 1040

Class

DB_common
DB_common is the base class from which each database driver class extends

Code

function executeMultiple($stmt, $data) {
  foreach ($data as $value) {
    $res =& $this
      ->execute($stmt, $value);
    if (DB::isError($res)) {
      return $res;
    }
  }
  return DB_OK;
}