resource prepare (
string $query
)
Gets a SQL statement ready so it can be run by execute().
$query
the query to prepare
resource - the query handle or a DB_Error object on failure
This function can not be called statically.
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());
}
?>