my question might better understood if provide (simplified) example of scenario. have 2 tables, event , course. event table contains eventid, courseid, , eventdate. course table contains courseid, , coursename.
i add new event. understand query follows:
insert event (eventid,courseid,eventdate) values ( null,'2','2011-03-01');
but instead update event providing coursename instead of courseid. how go doing this?
edit: apparently there isn't way mysql query. i'm trying in php , attempting allow user update event record. convenient user add new event based on name of course, preferably dropdown box.
thanks
insert event ( eventid, courseid, eventdate ) select null, c.courseid, '2011-03-01' course c c.coursename = 'course name goes here';
Comments
Post a Comment