DB_common::prepare() -- Prepares a SQL statement for later execution
Описание
Gets a SQL statement ready so it can be run by
execute().
Параметр
- string
$query
the query to prepare
Возвращаемое значение
resource - the query handle
or a DB_Error object on failure
Заметка
Эта функция не должна вызываться статически.
Пример
Пример 34-1. Using prepare() <?php
// Once you have a valid DB object named $db...
$sth = $db->prepare('INSERT INTO numbers (number) VALUES (?)');
if (PEAR::isError($sth)) {
die($sth->getMessage());
}
$res =& $db->execute($sth, 1);
if (PEAR::isError($res)) {
die($res->getMessage());
}
?> |
|
HIVE: All information for read only. Please respect copyright! |
|