DB_common::autoPrepare()

DB_common::autoPrepare() --  Prepares an INSERT or UPDATE statement based on variables you supply

Synopsis

Описание

Automatically builds an INSERT or UPDATE SQL statement so it can later be used by execute() or executeMultiple().

Параметр

string $table

name of the table

array $table_fields

ordered array containing the fields names

Be aware that these fields are assigned ? placeholders, therefore the data you pass to them in the execute() will be automatically escaped and quoted according to the current DBMS's requirements.

integer $mode

type of query to make (DB_AUTOQUERY_INSERT or DB_AUTOQUERY_UPDATE)

string $where

a string to be used in the WHERE clause. This is only used when $mode is DB_AUTOQUERY_UPDATE. The string is put directly into the query, so you must escape and quote literals according to the DBMS's standards.

Возвращаемое значение

resource - resource handle for the query or a DB_Error object on failure

Throws

Заметка

Эта функция не должна вызываться статически.

Пример

См. также

"Intro - Prepare & Execute", "Intro - autoPrepare & autoExecute", prepare(), execute(), executeMultiple(), autoExecute()

    Поддержать сайт на родительском проекте КГБ