Teacher can add, delete but need to fix error. Read description.

I receive the folowing error when a teacher tries to edit a course:

Notice: Undefined index: categoryId in
C:\Users\yomac_000\Documents\GitHub\website\update_ac.php on line 9

Notice: Undefined index: name in
C:\Users\yomac_000\Documents\GitHub\website\update_ac.php on line 9

Notice: Undefined variable: result in
C:\Users\yomac_000\Documents\GitHub\website\update_ac.php on line 15
ERROR