WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Database Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Database Discussion Forum This is the place to find help resolving those nagging questions you have about implementing and using all kinds of databases. Need help writing a query? Need an opinion on Oracle? Post here!

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-16-2004, 04:32 PM
WebProWorld New Member
 

Join Date: Jun 2004
Posts: 2
dchuke RepRank 0
Default Relational Tables in MySQL

Hello,
I have three MySQL tables in a database and they are supposed to be of a one-to-one relationship, such that each record in each table is unique, and each line in all three tables are for the same record. i.e. a record on table 1 line 1 is part of a record on table 2 line 1 which are part of a record on table 3 line 1.
The reason for three seperate tables was that the input process is dynamic from three web forms. Each form has its own "submit" button and so the tables get filled one after the other. I need to be able to relate each table to the other such that a primary key in table 1 gets populated in the corresponding line in tables 2 and 3 as a foreign key. So when search queries are run, it will be possible to successfully "JOIN" matching records from all tables.

If further clarification is required, I will be happy to provide this. BTW I am using DreamweaverMX 2004 as my web building tool and then uploading the updated files into my site located on a web hosting server. The MySQL tables are, of course, also on this server.

Regards,
D
__________________
ShakaZulu!!!
Reply With Quote
  #2 (permalink)  
Old 07-18-2004, 11:29 PM
WebProWorld Veteran
 

Join Date: Apr 2004
Posts: 453
HardCoded RepRank 0
Default

This belongs in the database forum, but here goes:

(Vanilla) MySQL is not relational in that sense. It does not have the concept of foreign keys. You have to build these into your app for when you do inserts.

You'll probably be excited about this:
http://ca3.php.net/function.mysql-insert-id
Reply With Quote
  #3 (permalink)  
Old 10-10-2004, 05:40 AM
WebProWorld New Member
 

Join Date: Oct 2004
Posts: 1
DmmH RepRank 0
Default

Quote:
Originally Posted by HardCoded
This belongs in the database forum, but here goes:

(Vanilla) MySQL is not relational in that sense. It does not have the concept of foreign keys. You have to build these into your app for when you do inserts.

You'll probably be excited about this:
http://ca3.php.net/function.mysql-insert-id
this might come a bit late, but the INNO-DB table type does support relational tables actually ;)
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Database Discussion Forum
Tags: , ,



Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.2.0