Hi
Ive got 2 tables. I'l explain:
I am creating a system where people can buy their insurance on-line. One table will hold the proposers name, DOB, address, email etc. and another table will contain the rest ofthat group to be insurance so name, dob
So far im doing something like this:
create table proposer (
id int not null primary key auto_increment,
name varchar,
dob varchar,
telephone varchar,
email varchar
) type = innodb;
create table companions (
id int not null primary key auto_increment,
name varchar,
dob varchar,
owner int,
FOREIGN KEY (owner) REFERENCES proposer(id)
) type = innodb;
Now obviously there maybe more than one entry on the second table and I want to be able to use the same number in the 'owner' field througout that same group.
The problem I'm getting - well it seems to work but then mucks up and starts auto_incrementing!!
In my insert query to table 2 i'm using LAST_INSERT_ID()
Please can someone help??
Thank you!!
Will