Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

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

by greywolf (Priest)
on Aug 25, 2001 at 20:51 UTC ( [id://107840]=note: print w/replies, xml ) Need Help??


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

You could try:
$statement = "SELECT id, size FROM table WHERE "; for ($x = 0; $x < @id; $x++) { if ($x > 0) { $statement .= " || "; } $statement .= "id = '$id[$x]'"; }


Update: fixed a typo

mr greywolf
  • Comment on Re: how do i construct a sql select statement, where i want to get the where clauses out of an array
  • Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2024-04-26 05:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found