You are here

function DB_common::autoPrepare in Flickr API 5

Automaticaly generates an insert or update query and pass it to prepare()

@uses DB_common::prepare(), DB_common::buildManipSQL()

Parameters

string $table the table name:

array $table_fields the array of field names:

int $mode a type of query to make:: DB_AUTOQUERY_INSERT or DB_AUTOQUERY_UPDATE

string $where for update queries: the WHERE clause to: append to the SQL statement. Don't include the "WHERE" keyword.

Return value

resource the query handle

1 call to DB_common::autoPrepare()
DB_common::autoExecute in phpFlickr/PEAR/DB/common.php
Automaticaly generates an insert or update query and call prepare() and execute() with it

File

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

Class

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

Code

function autoPrepare($table, $table_fields, $mode = DB_AUTOQUERY_INSERT, $where = false) {
  $query = $this
    ->buildManipSQL($table, $table_fields, $mode, $where);
  if (DB::isError($query)) {
    return $query;
  }
  return $this
    ->prepare($query);
}