title: looping through result rows and storing column data into stored procedure variables mysql
body: <p>I m trying to learn stored procedure in mysql. I know the below example does not need SP, but this is ONLY for my learning purpose - just to understand how to loop through rows, and pick specific column data inside the row.</p>
  
  <p>Assume that a SELECT on the table returns 5 records from my table with following structure -</p>
  
  <p>table name: t1
  columns: c1,c2,c3</p>
  
  <p>i would like to loop through each of the 5 rows, and for each row, i would like to store the column cell data into SP variables varc1,varc2,varc3, so that varc1 = c1, varc2 = c2, varc3 = c3. i would be using these varc1,varc2,varc3 for further computation while within the loop.</p>
  
  <p>i am assuming that a stored procedure is required, but i am not getting the approach in doing the row iteration and then picking data from each column in the row under consideration in the loop.</p>
  
  <p>quite new to mysql/ stored procedure.
  thank you!</p>