June 2002
Beginner
759 pages
80h 42m
English
Many database drivers allow you to use question marks
as placeholders in SQL statements and then bind values to the
placeholders before executing them. This enables you to prepare a
single statement with placeholders and reuse it for each row of the
database. For example, the prepare statement might read:
$st_handle = $db_handle->prepare(q{
insert into books (isbn, title) values (?, ?)
}) || die db_handle->errstr;And a subsequent execute
statement might read:
$st_handle->execute("1-56592-286-7", "Perl in a Nutshell")
|| die $db_handle->errstr;