I have two tables in my database. In the first table (member) an autonumber is assigned (membernum) when info is submitted through the form. I'd like to be able to include this number (as a foreign key) in the second table (car) also. Here is what I tried without success:
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>

mysql_query ("INSERT INTO car (membernum, year, model)
VALUES (mysql_insert_id(), '$year', '$model')");
[/code]
Any ideas on how to do this? Also, how can I set the auto increment number to start with a higher number.

Then it should work. To start at a higher number for initial value, you'll need to force the number for the first record. What I've done is use a dummy record with a defined number. Later, after you have "real" records you can delete the dummy.

<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by rod k:insert_id doesn't work without placing a null in to it's place in the query (it's not like a timestamp), so you may need to specify that in the first query.

Then it should work. To start at a higher number for initial value, you'll need to force the number for the first record. What I've done is use a dummy record with a defined number. Later, after you have "real" records you can delete the dummy.

[/quote]

Thanks. I tried that and I'm still having problems. The first table gets the data, but the second table doesn't. HEre is my code.