Jump to content

Normalized Tables, but now am confused


kenwvs

Recommended Posts

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!

Ken

Here 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]
Link to comment
https://forums.phpfreaks.com/topic/19502-normalized-tables-but-now-am-confused/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.