i must sign in my items i'm selling (mostly gaming systems and games)

i wish to see which items has which groups which is my query:

select * From products left join products_categories on (product_id=id) ;
+------+------+------------+-------------+----------
| id   | name | product_id | category_id | and more
+------+------+------------+-------------+----------
|    4 | Xbox |          4 |           2 |
|    5 | PS3  |          5 |           2 |
|    7 | BAD  |       NULL |        NULL |
etc...
+------+------+------------+-------------+---------

here i've got a product (#7 - BAD) that i'd rather not see since i have removed the course,

I'd rather not begin to see the product without groups?

The LEFT JOIN command can be used to combines null matching rows that are saved in related tables To be able to join these tables, the join table need a common area (generally known as foreign key) in the left table. This kind of join requires key phrases ON or USING.

Example:

SELECT * 
From products 
LEFT JOIN products_categories ON (product_id=id) 
WHERE product_id IS NOT NULL;

Or make use of the INNER JOIN:

The JOIN or INNER JOIN command can be used to combines non-null matching rows that are saved in related tables To be able to join these tables, the join table need a common area (generally known as foreign key) in the left table. This kind of join requires key phrases ON or USING.

Example:

SELECT * From products INNER JOIN products_categories ON (product_id=id);

Now, I would suggest to include a flag for inactive or active product, by doing this you don't have to take away the groups for any product whether it's inactive. By doing this, if you wish to re-activate it, simply turn the flag to 1 or whatever flag you utilize.

Example:

SELECT * 
FROM products 
INNER JOIN products_categories ON (product_id=id) 
WHERE products.is_active = 1;