Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^3: DBI and arrays

by tweetiepooh (Hermit)
on Jan 17, 2012 at 13:27 UTC ( #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? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2022-09-30 02:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer my indexes to start at:




    Results (125 votes). Check out past polls.

    Notices?