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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.