I am using an while loop over a select statement and it’s doing some calucaltion.Each iteration I am getting a value.But I have no idea how to store this value.Can anyone give me an idea how to do this?
I want to process everthing in mysql and then returns all values to server side.
$result_array = array();
SET i=0;
WHILE i<total_count DO
select rate_margin*2 INTO @b from rate LIMIT i,1;
$store_array[] = put your data here on each loop and it will build an array
SET i = i + 1;
END WHILE;
Select @b;
NO need of redesiging database table.If you would have looked my question you will never say like this.I have mentioned that I need to loop through the select statement and every time I get a value from select query and I need to store this value.Temprory table is the solution for this.I have sucessfully created temp table and able to store multiple value.