I tried something like this, but it does only delete the categories so far.
DELETE s, i 
FROM imgbox_categories s 
INNER JOIN imgbox_images i 
ON s.category_id = i.fk_category_id 
WHERE category_id = @id
Additionaly I get an error
Incorrect syntax near ','.
 
     
     
     
    