MySQL insert position value
Create Auto Increment Position Column when you Create product TABLE 

EXAMPLE 

               Create Table category_product
               ( 
              id_category int,
              id_product int,
               position int Auto_Increment=1
               ) 


Then Simple Insert 

    Insert into category_product
     select 2,id_product from Product