Okay I also fixed some stuff with the category table. Added default -1 to parent_id and make cat_name unique