I am creating two tables with names group,phone
group caontains id,name,place,phone numbers
phone contains id,phone numbers
my query is that phone table should accept id and phone numbers that matches group table(id and phone numbers) can one please help me .

Recommended Answers

All 4 Replies

Might want to take a look in your textbook or around the MySQL documentation before you start asking homework questions without showing work.

If you dont know the answer be idle dont make unnecessary comments,you think ur a jeneous,dont think more about you.

http://dev.mysql.com/doc/refman/5.1/en/innodb-foreign-key-constraints.html Check for foreign key constraints, primary key, foreign key in google.

From the above link:
InnoDB rejects any INSERT or UPDATE operation that attempts to create a foreign key value in a child table if there is no a matching candidate key value in the parent table.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.