How to update a multiple rows all at once with a procedure.? Im trying to do a procedure to update an (for now) empty column recently added.

In this new column, i will put the values of the result obtained by a join query.
To explain it better, i have this

delimiter // 
create procedure update_amount_products (in id int)
begin
update categories set products_amount= 
           (SELECT DISTINCT COUNT( products_to_categories.products_id ) 
FROM categories_description
INNER JOIN products_to_categories ON products_to_categories.categories_id = categories_description.categories_id
INNER JOIN products_description ON products_description.products_id = products_to_categories.products_id
WHERE categories_description.categories_id =id)
WHERE categories_id = id;
end
//
call update_amount_products(id);


So what i want, is to not calling the procedure everytime with diferents "ids", i want to update all at once (because there are over 1500 rows with diferents ids). What can i do?

I have been thinking of some kind of "for" to get all the ids and saving them on a variable so later used on my update procedure, but i've seen that there isn't any array possibilty in sql nor foreach. 

Any help is highly appreciate it.
Finally i got it, after several tries i manage to get what i needed, so i'll share my answer.

First i made one procedure to update one single row in the column:

delimiter //
create procedure update_amount_products (in id int)
begin
update categories set products_amount= 
           (SELECT DISTINCT COUNT( products_to_categories.products_id ) 
FROM categories_description
INNER JOIN products_to_categories ON products_to_categories.categories_id = categories_description.categories_id
INNER JOIN products_description ON products_description.products_id = products_to_categories.products_id
WHERE categories_description.categories_id =id)
WHERE categories_id = id;
end
//

DELIMITER ;


Then i realized i could handle the whole column by calling the procedure with another procedure with a loop on it

DELIMITER $$
CREATE PROCEDURE update_products_amount()

   BEGIN
      DECLARE a INT Default 1 ;
      DECLARE category_length int;

      select max(categories_id) into category_length from categories_description;

      simple_loop: LOOP
         SET a=a+1;

         call update_amount_products(a);

         IF a &gt;= category_length THEN
            LEAVE simple_loop;
         END IF;
   END LOOP simple_loop;
END $$
DELIMITER ;

commit;


Finally, all i have to do now, is to call my last procedure and voilá, all my column will be automatically updated.

call update_products_amount();