When a risk is created it can have one or more plans (hence the second table) The data that is inserted comes from a cgi form. So I want to insert all risk data into risk_tb and plan_tb.
The question is how do I do this with linked tables? Some people have suggested using last_id(); to get the last inserted id, but this is a multi-user database, so if another user inserts a record, wont this value be the wrong one?
risk_tbl which contains +---------------------------------------------+ project_id int risk_id int auto-increment some other fields
Primary Key (project_id, risk_id) +---------------------------------------------+
plan_tbl +-------------------------------------------------------------------+ plan_id int auto_increment project_id int (should be the project id for the risk) risk_id int (should be the risk_id) plan
primary key (plan_id) +-------------------------------------------------------------------+
-- Regards,
David Johnston VSP Intern
======================================================================== Sun Proprietary and Confidential; Internal Use only. ======================================================================== This email may contain confidential and privileged material for the sole use of the intended recipient. Any review or distribution by others is strictly prohibited. If you are not the intended recipient please contact the sender and delete all copies.
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]