hello friend...want to ask something after completing my student form now i am up to classes table so i make a table in DB which consist of two fields 'class_id' and 'class_name'.class_id is auto_incre.so i thought to add a field in the same student form in which the user will enter the class name and will hit the add button and in the student table in DB there will be a field name class and by hitting the add button the class_id will be added to the student table in DB from the class table instead of class name.i am confuse with last part is my logic is right if not let me guide please.thanks

6 Years
Discussion Span
Last Post by extemer

The idea looks correct.
Each class should have an ID and a name. The ID is the unique key. The class name should not be stored anywhere else than in the classes table, and refereoces to the class should contain the ID, not the name.


shall i use query to fill the class_id from class table into student table

Edited by extemer: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.