Automatically builds an INSERT or UPDATE SQL statement so it can later be used by execute() or executeMultiple().
name of the table
ordered array containing the fields names
type of query to make (DB_AUTOQUERY_INSERT or DB_AUTOQUERY_UPDATE)
in case of update queries, this string will be put after the WHERE statement
Таблица 22-1. Возможные значения PEAR_Error
| Error code | Error message | Reason | Solution |
|---|---|---|---|
| DB_ERROR_NEED_MORE_DATA | insufficient data supplied | The ordered array, which has to contain fields names, is empty. | Check and correct your fields names array. |
| DB_ERROR_SYNTAX | syntax error | You use an unknown mode. | Available modes are only DB_AUTOQUERY_INSERT for INSERT queries or DB_AUTOQUERY_UPDATE for UPDATE queries. |
| DB_ERROR_NODBSELECTED | no database selected | No database was chosen. | Check the DSN in connect(). |
| every other error code | Database specific error | Check the database related section of PHP-Manual to detect the reason for this error. |
Пример 22-1. Using autoPrepare()
|
"Intro - Prepare & Execute", "Intro - autoPrepare & autoExecute", prepare(), execute(), executeMultiple(), autoExecute()
| Пред. | Начало | След. |
| DB_common::autoExecute() | Уровень выше | DB_common::createSequence() |
HIVE: All information for read only. Please respect copyright! |