MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMySQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old June 8th, 2000, 07:01 AM
Robert_J_Sherman
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
I'm quite new to mysql, and though I have read quite thuroughly several different books, and a number of tutorials, one thing
continues to escape me.

Since we can "join" data from multiple tables for display purposes, can't we do essentially the reverse?

Given the Normalization Process, it's necessary to break a database down into smaller tables, each "interconnected" via id's etc..

Were my question comes in, is when go to insert data into those tables, obviously from one form.. what's the approach there?

Is there a method for inserting data into multiple tables in one fail swoop? instead of doing them one by one?

Any information on this, live tutorials, etc.. would be very very helpful.. this seems to be the only confusion I have at this point.. well.. not exactly the other one is sorta wrapped into that one, and it deals with "incrementing" the row identifiers between tables, since it appears that only one column in a table can be "auto incremented".. so I'm a little lost on that aspect of it.. after all a table may contain multiple id fields, one for it's rows, and one or more which links it to other tables/rows.

------------------
SnR Graphics,
Low Cost Hosting and Web Development.

Reply With Quote
  #2  
Old June 8th, 2000, 03:36 PM
rod k rod k is offline
Apprentice Deity
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jul 1999
Location: Niagara Falls (On the wrong side of the gorge)
Posts: 3,237 rod k User rank is Private First Class (20 - 50 Reputation Level)rod k User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 m 8 sec
Reputation Power: 13
Send a message via AIM to rod k
Short answer: no.

You can't insert to multiple tables in one statement. Also, why would you have more than 1 auto_increment field, they'd essentially contain the same value unless you specifically set one to a higher value at some point, in which case they'd have the same offset.

When you need to include an id from another table you have to get the id from that table.

Reply With Quote
  #3  
Old June 8th, 2000, 04:03 PM
Robert_J_Sherman
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
You know, all of a sudden I feel pretty much like an idiot URL

Just reading your post really turned on the light bulb. All this time for some damn reason, I was thinking that each table would be getting new data each time a user say completed a form.

But due to normalization that wouldn't be the case, since for example a table for "states" would already be a complete table, the associated states ID would be "added" to the user information, etc...

--------------------------------------------
But.. I am still not completely sure how I would approach something like putting a usersname/password to one table, and all his information into another table, I mean they would surely need to be linked somehow?

wouldn't there need to be a linking 'id' fields between those two tables? Or would we just assume that entry would be sequential and the '1' id field would serve to 'join'?

---------------------------------------------

------------------
SnR Graphics,
Low Cost Hosting and Web Development.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > INSERTING DATA TO MULTIPLE TABLES


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway