laziness, impatience, and hubris | |
PerlMonks |
Re: how do i construct a sql select statement, where i want to get the where clauses out of an arrayby thpfft (Chaplain) |
on Aug 25, 2001 at 21:11 UTC ( [id://107843]=note: print w/replies, xml ) | Need Help?? |
mysql supports the IN() clause. So it might be easiest to use this: SELECT id, size FROM table WHERE id IN ('$id[0]', '$id[1]', ...)Which i would build this way, but there are plenty of others:
Apparently there are issues with the length of @id: past a certain point it would need to be divided into chunks for this approach to work. update *sigh*. redundant again.
In Section
Seekers of Perl Wisdom
|
|