Try forming the query with only the first array element, then iteratring through the rest concatinating OR clauses onto the end of the query. And then after the loop sending the query to the db. See my below pseudo code.
String query = "UPDATE users SET status = no WHERE name = array[0]" While(array[1:end] contains elements) { query = query + " OR name = array[i]" } Execute(query); John A. McCaskey Software Development Engineer IP Sciences, Inc. [EMAIL PROTECTED] 206.633.0449 -----Original Message----- From: Jonathan Villa [mailto:[EMAIL PROTECTED] Sent: Friday, January 02, 2004 9:17 AM To: [EMAIL PROTECTED] Subject: Change from loop to single query I have a loop which is similar to the following: while(array contains elements) { UPDATE users SET status = no WHERE name = array[i] } great, it works but the query runs many times. I want to make only one call to the database and have all the elements in the array be included in the query -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]