title: Mass product category update (adding `home` category to all products) - Prestashop 1.6.0.6
body: <p>I observed that the count of all products is not equal to the number of products in category <code>home</code>. It is due to the fact that this biggest parent category was not always selected during product adding. So some products belong to <code>home</code> but others not. </p>
  
  <p>While I need to display the correct number of products for the category <code>home</code> page, I was looking in the database for the columns that holds the categories but not found them in <code>ps_product</code> or  <code>ps_product_lang</code>.</p>
  
  <p>what is the idea behind an sql query that can mass modify the appropriate fields in database so that all my products belong to category <code>home</code>.</p>
  
  <p>Your usual help is appreciated. Thank you.</p>
  
  <p><strong>Edit:</strong>
  I found that the table in database is <code>ps_category_product</code>. Is it the only one?</p>
  
  <p>this table is like this:</p>
  
  <pre><code>+-------------+------------+----------+
  | id_category | id_product | position |
  +-------------+------------+----------+
  |          11 |          1 |        1 |
  |          11 |          2 |        2 |
  |          11 |         10 |        3 |
  +-------------+------------+----------+
  </code></pre>
  
  <p>I need maybe to create x lines (x= the number of products) . each line has id_category=1 and id_product= product id and position= position++. Is is the best approach?</p>
  
  <p>Any help regarding how to implement it in sql?</p>
  
  <p>Thanks again.</p>