mrjonnytou Posted June 26, 2008 Share Posted June 26, 2008 Here's the thing: I have a page with names and job titles. When a name is clicked, an edit form opens, populated with the persons details (first_name, last_name, job_role). All fields can be edited. I would like a hidden field to appear when the user changes the job_role field asking the user when "Joe Bloggs" finished/started their new role and give them a field to enter this date into. On saving, I would like the this date to be stored in two places in the same table. Basically, I'd like to build up a table with persons job history. The tables I'm working with include: person, person_history and position person table includes: person_id(key), first_name, last_name person_history table includes: person_id, position_id, date_from, date_to, id(key) position table includes: position_id(key), position How can I save the date entered to the 'date_to' field in the person_history table AND also as a new entry in the 'date_from' field? ??? ??? ??? Any help is appreciated, Thanks Link to comment https://forums.phpfreaks.com/topic/112041-phpmysql-question/ Share on other sites More sharing options...
xyn Posted June 26, 2008 Share Posted June 26, 2008 make 2 queries... if the field type is DateTime then just use MySQL's now() function. Link to comment https://forums.phpfreaks.com/topic/112041-phpmysql-question/#findComment-575130 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.