Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Using CGI.pm params to make a DBI MySQL query

by projekt21 (Friar)
on Oct 09, 2001 at 20:04 UTC ( [id://117785]=note: print w/replies, xml ) Need Help??


in reply to Using CGI.pm params to make a DBI MySQL query

If you do that:

my $sth = $dbh->prepare("INSERT INTO tbl VALUES (?,?,?)"); $sth->execute(@values) or die $dbh->errstr;

you should win twice:

  1. You get your values quoted.
  2. You can use an array.

Hope that helps.

alex pleiner <alex@zeitform.de>
zeitform Internet Dienste

Replies are listed 'Best First'.
Re: Re: Using CGI.pm params to make a DBI MySQL query
by George_Sherston (Vicar) on Oct 09, 2001 at 20:08 UTC
    Hmm, that's particularly good in my case because when I'm not making my query with CGI params I'm making it with the output of a SELECT query, and that output is in the form of an arrayref. Using an array avoids the intermediate step of breaking out the array into its elements.

    § George Sherston

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://117785]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-18 22:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found