Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: DBI and arrays

by tweetiepooh (Hermit)
on Jan 17, 2012 at 13:27 UTC ( [id://948314]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @param = <array of values to pass TO database>;
    my $sql = <some SQL with placeholders = ? to take values>;
    my $array_ref = $dbh->selectall_arrayref($sql,undef,@param);
    
  2. or download this
    my $dbh = <create database handle>;
    my $sth = $dbh->prepare("select * from table where col1=? and col2=?")
    +;
    ...
    @param = ("test2a","test2b);
    $array_ref = $sth->selectall_arrayref($sth,undef,@param);
    ...
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-04-19 03:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found