in reply to Re: Re: Re: How hashes present keys and values.
in thread How hashes present keys and values.
? Where $l_database is a reference to a database handle, $l_tablename is a string, and @l_fields is a list of field names for the insert. Returns a reference to the statement handle.sub create_SQLprepared{ my ($l_database, $l_tablename,@l_fields) = @_; my $l_fieldnames; my $l_placeholder; my $l_statement; my $l_fieldnames = join ",", (@l_fields); foreach (@l_fields) {$l_placeholder .= "?"} $l_placeholder = (join ",", (split //, $l_placeholder)); print "INSERT $l_tablename (" . $l_fieldnames . ")\n VALUES (" . $ +l_placeholder . ")"; $l_statement = $l_database->prepare("INSERT $l_tablename (" . $l_f +ieldnames . ")\n VALUES (" . $l_placeholder . ")"; return (\$l_prepare); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: doing it the right way
by merlyn (Sage) on Dec 13, 2000 at 20:30 UTC | |
|
Re: doing it the right way
by chipmunk (Parson) on Dec 13, 2000 at 20:29 UTC |