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

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

how can perform this with query

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.