I'm actually looking for the source code for execute() (IE sub execute {
.. }), do() and quote() are in DBI.pm, prepare() is in DBD/mysql.pm but
execute in neither.
The source code for execute is in dbd_st_execute() in dbdimp.c, and if you want
to know how the quoting is done, you will need to
On Wed, 12 May 2004, JupiterHost.Net wrote:
> Ronald J Kimball wrote:
> >
> > JupiterHost.Net [mailto:[EMAIL PROTECTED] wrote:
> >
> >
> >>I found do() and quote() in DBI.pm, prepare() in DBD::mysql, but I
> >>couldn't find execute() - I wanted to see how it does the quoting
> >>exactly (for bi
Ronald J Kimball wrote:
JupiterHost.Net [mailto:[EMAIL PROTECTED] wrote:
I found do() and quote() in DBI.pm, prepare() in DBD::mysql, but I
couldn't find execute() - I wanted to see how it does the quoting
exactly (for binary data) -
Anyone know where execute() is?
All of these are covered in
JupiterHost.Net [mailto:[EMAIL PROTECTED] wrote:
> I found do() and quote() in DBI.pm, prepare() in DBD::mysql, but I
> couldn't find execute() - I wanted to see how it does the quoting
> exactly (for binary data) -
>
> Anyone know where execute() is?
All of these are covered in the DBI docume
Thanks guys!
You don't need to call quote(). When you bind values to placeholders, the
values are quote()d automatically.
So:
$dbh->do(
'INSERT INTO Stuff (Id,Foo,Bar,Baz) VALUES (NULL,?,?,?)',
undef,
$foo, $bar, $baz
) or die
is the same (IE does the same things
On Wed, 2004-05-12 at 10:48, JupiterHost.Net wrote:
> Thanks for all the replies! Its much clearer now :)
>
> Just to clear up the qw() issue, I included quotes so that the data
> would be quote()ed for the query, not sure if that was necessary or not
> since do() didn't do quote()...
>
> IE I
JupiterHost.Net [mailto:[EMAIL PROTECTED] wrote:
> Just to clear up the qw() issue, I included quotes so that the data
> would be quote()ed for the query, not sure if that was necessary or not
> since do() didn't do quote()...
>
> IE I was passing "'data'" (single quotes as part of the string)
JupiterHost.Net [mailto:[EMAIL PROTECTED] wrote:
> perldoc DBI
> has this:
> $rv = $dbh->do($statement, \%attr, @bind_values);
>
> So would this be a proper use of it:
>
> $dbh->do(
> 'INSERT INTO Stuff (Id,Foo) VALUES (NULL,?)',
> undef,
> qw('foo' 'bar' 'baz')
> ) or die
no, the @bind_values is a list to bound for that statement. It could 1
or many (i.e. if you have where id = ? and date = ? ). If you have a
list of values that need to be inserted into different rows, then
iterate through the array and execute the 'do'. A word of caution, if
the list is going to
Thanks for all the replies! Its much clearer now :)
Just to clear up the qw() issue, I included quotes so that the data
would be quote()ed for the query, not sure if that was necessary or not
since do() didn't do quote()...
IE I was passing "'data'" (single quotes as part of the string) and no
Howdy group!
perldoc DBI
has this:
$rv = $dbh->do($statement, \%attr, @bind_values);
So would this be a proper use of it:
$dbh->do(
'INSERT INTO Stuff (Id,Foo) VALUES (NULL,?)',
undef,
qw('foo' 'bar' 'baz')
) or die
# IE undef foro \%attr and include quoted data
That would e
11 matches
Mail list logo