hello guys...i have a class table in which there are two fields class_id and class_name and a student form in which there is a text field in which user will mention the student class and then hit add.this will retrieve class_id from class table instead of class name into student table.i want to retrieve the id of specfic field from one table and put it in the other table...is this possible with mysql queries to retrieve specfic id of the field from one table and input it into anonther table.if so please let me known.hope you understand my explaintion of my problem
extemer
-17
Junior Poster
Banned
Recommended Answers
Jump to PostYou mean like:
insert student(classId) select classId from class where...
Jump to PostYeah, I think that's what my example does.
I may have left off an "into". Student and Class are tables in this example.
INSERT into student(classId) SELECT classId FROM class WHERE...
All 5 Replies
Brillig
0
Light Poster
extemer
-17
Junior Poster
Banned
Brillig
0
Light Poster
extemer
-17
Junior Poster
Banned
extemer
-17
Junior Poster
Banned
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.