my problem is i get database of one school and its tell about childrens names there progress and address, stort, activities...lots of things

now these database can excess two kind of peoples one principle and teachers but teachers can see only some fields not all of them but principle can see every thing.

so pls help he about secure code how to make database or php code so its work properly