in reply to Query using more than one array!

Really, this is an SQL-question.

I think you want something (in SQL) like:

SELECT name, last_name, reg_num, month, year FROM members WHERE (reg_num = '12345' AND month = '03') OR (reg_num = '98564' AND month = '01') OR (reg_num = '33234' AND month = '01') OR ... AND year='2009'
SQL has no concept of arrays and cannot synchronize between the values of your 'IN' clauses.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Replies are listed 'Best First'.
Re^2: Query using more than one array!
by Anonymous Monk on May 13, 2009 at 10:45 UTC
    The problem is how to build this SQL query using the arrays?

      Use a loop to build the query string (and the parameters array passed to execute).

      Alexander

      --
      Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
        Can you show an example with code building the query string for the arrays?