kenwvs Posted September 2, 2006 Share Posted September 2, 2006 I had got to the point where I had all of my data being saved into my Mysql DB, and then it was suggested that I normalize my DB. I have done that and have ended up with 5 tables and 4 additional tables to join the many->many tables. The tables I have are workorders, employees, image, parts and remarks. I have then created work_employees, work_image, work_parts, and work_remarks table to join them together. I am lost as how to create the query now that will get the data from the form, the data will end up in the proper DB table, and work for me to call it back up to review it in a form later. My question is where am I going to want to send them to. Do they go to the actual table with all the fields, or do I send them to one of the join tables.... I have never done this before, as the query below was my first attempt with php and databases.Thanks for the help!KenHere is an example of the query I was using....[code]mysql_query ("Insert into `workorder`(ID,Work, Sched, Name, Site, Serial, Hours, Starts, Issue, Severity, Resolution, Assistance, NumberA, PartsA, NumberB, PartsB, NumberC, PartsC, NumberD, PartsD, NumberE, PartsE, NumberF, PartsF, NumberG, PartsG, Safety) VALUES ('', '$Work', '$Sched', '$Name', '$Site', '$Serial', '$Hours', '$Starts', '$Issue', '$Severity', '$Resolution', '$Assistance', '$NumberA', '$PartsA', '$NumberB', '$PartsB', '$NumberC', '$PartsC', '$NumberD', '$PartsD', '$NumberE', '$PartsE', '$NumberF', '$PartsF', '$NumberG', '$PartsG', '$Safety')") or die(mysql_error()); mysql_query ("Insert into `image`(Upload1, Upload2, Upload3, Upload4) VALUES ('$Uploads1', '$Uploads2', '$Uploads3', '$Uploads4')")or die(mysql_error()); echo "Work Order # '$Work' has been Updated Successfully";[/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.