my $sql = "SELECT * FROM table WHERE";
foreach $record_id ($record_ids) {
$sql .= " record_id EQ $record_id OR ";
}
Needs some tweeking but hopefully you get the idea (the last one needs to
not include the OR).
HTH
Nigel
-----Original Message-----
From: Mariusz [mailto:mkubis22@;hotmail.com]
Sent: 12 November 2002 17:34
To: perl
Subject: perl & MySQL
I would like to be able to select records from the a table where record_id
and $record_id from my @record_ids matches. I know I could go through a loop
and send a SELECT query for each element in the array but is there a better
way? How can I accomplish the same but only sending one query?
thanks,
Mariusz
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]