title: How to cycle with an array in MySQL?
body: <p>I'd like to create a stored procedure or a normal query with values passed with an array.</p>
  
  <p>Example:</p>
  
  <pre><code>CREATE PROCEDURE proc() 
  BEGIN 
      DECLARE cont INTEGER; 
      DECLARE var ARRAY; 
      SET cont = 0;
      SET var = ("hi", "hello", "good", ...)
  
      WHILE cont &lt; 12 DO 
          SELECT * FROM tablex
          WHERE name = var[cont];
          SET cont = cont + 1; 
      END WHILE; 
  END;
  </code></pre>
  
  <p>Obviously this is will not work, but I'd like to know how to achieve this.</p>