. . . . . bought it from a school but no codes . . . .
In general school licensing falls in to one of three categories:
single installation licence
a multi user licence with fixed number of seats/PC's
a network licence with installation on all computers with a licencing server controlling the number of active seats/PC's at any one time to the limit of the purchased concurrent licence numbers.
Depening on the schools licensing model:
If single installation and they are no longer using it, then they should give you the serial number and contact Magix Support to inform them that the product has been sold on and have their registration of the product cancelled.
If the licencing is a multi user or network licence and they have sold unused licenced copies they are in breach of their licensing conditions and you will not be able to use the software.