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

Re: how do i construct a sql select statement, where i want to get the where clauses out of an array

by runrig (Abbot)
on Aug 25, 2001 at 22:42 UTC ( [id://107852]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $where_clause = 'where id in ('.join(",",("?") x @id).')';
    $sql .= $where_clause;
    my $sth = $dbh->prepare($sql);
    $sth->execute(@id);
    
  2. or download this
    $sql .= 'where id = ?';
    my $sth = $dbh->prepare($sql);
    ...
     $sth->execute($id);
    ...
    }
    

Log In?
Username:
Password:

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

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

    No recent polls found