Foreign Key help

admin

Administrator
Staff member
Ok, lets say that I have something like this in MySQL:

create table story_table (
id not null auto_increment;
some_text text
);

And the a second table that has this:

create table links_table (
id not null auto_increment;
story_id int;
URL text
);

Now, when I if I have a user fill out a form with the information necessary for both tables, how would I obtain story_table.id so that I can insert the number into the links_table.story_id?

Meaning, story_id is a foreign key in story_link_table.
 
Back
Top