Elby,
Friday, June 28, 2002, 11:13:52 PM, you wrote:
EV> create table person(
EV> id_person smallint not null primary key auto_increment,
EV> name varchar(10));
EV> create table friends(
EV> id_friend smallint not null primary key auto_increment,
EV> age smallint,
EV> id_person smallint not null,
EV> foreign key (id_person) references person (id_person));
EV> For example:
EV> I put a row in table PERSON with "id_person = 1"
EV> If I try to put in table FRIENDS "id_person = 7", I get...why?
EV> Should not give error?
EV> And the referential integrity?
I guess your table is not InnoDB, they are MyISAM :)
If you want to have foreign key constraints, you must use InnoDB table
type:
http://www.mysql.com/doc/S/E/SEC446.html
--
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Victoria Reznichenko
/ /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED]
/_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net
<___/ www.mysql.com
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php