» Quick Links
You can make money on these forums
We Share profits with you
Google
Google Adsense
Google Adwords
YPN
Yahoo
MSN Search
Web Directories
Web Hosting
Web Hosting Offers
Hosting News
Suggestions
Link Building
Domain Names
PHP Forums
MySQL Forums
» More Links
OSP News
Reseller Hosting
Shared Hosting
Dedicated Servers
Google Adsense
Search Engine Marketing
Link Development
Affiliate Marketing


» Advertising
Multiple DC PR Check

Free SEO Tools


Go Back   Webmaster Forums > Website Developement / Programming > MySQL Forums

MySQL Forums Share Your Ideas and Tips about MYSQL. Ask questions about MYSQL. Table Design and Much More...

Reply
 
Thread Tools Display Modes
  #1  
Old 05-07-2007, 04:14 AM
asd123456 asd123456 is offline
Junior Member
 
Join Date: Oct 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
asd123456 is on a distinguished road
Default establishing relations??

Hi friends,
Please inform me the way to establish relation 1:M between 2 tables using MySQL Administrator? Like, I need 2 tables:

BANK
id_bank name address
1 A B
2 C D

ACCOUNTS
id_bank account_N
1 1000001
1 1000002
1 1000003
2 2000001

Many accounts can be related to each bank. I described id_bank in ACCOUNTS table as foreign key, but I could enter into ACCOUNTS only one row with each id_bank.
Please, help me!
Thanks -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Revenue Sharing Ads ( ?):
  #2  
Old 05-07-2007, 07:14 AM
sierra sierra is offline
Senior Member
 
Join Date: Jul 2006
Posts: 220
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 17
sierra is on a distinguished road
Default Re: establishing relations??

Maybe, you could have set wrong PRIMARY or UNIQUE KEY on id_bank in your ACCOUNTS table. The PRIMARY KEY on ACCOUNTS should instead be (id_bank, account_N) if you want the possibility to have the same account_N for different banks or only (account_N) if you want it to be unique across all banks. In this second case there should just be a simple INDEX on id_bank in ACCOUNTS. -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Reply


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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
establishing SSL connection? shroff MySQL Forums 1 04-03-2007 09:29 AM
Relations of a Foreign KEY.... rowlin MySQL Forums 1 03-23-2007 09:41 AM
establishing connections? derrek MySQL Forums 1 02-28-2007 06:36 AM
designing table relations? Jett MySQL Forums 1 08-17-2006 09:23 AM


All times are GMT. The time now is 05:05 AM.