Forum Moderators: phranque

Message Too Old, No Replies

Coldfusion/MYSQL Insert Query

         

almo136

6:31 pm on Dec 5, 2009 (gmt 0)

10+ Year Member



Hi I need a query which will input 2 rows into 2 different mysql tables (tableA and tableB) once the user hits a submit button

Table A has a column with an auto incrementing primary key.

I need the row in tableB to have a foreign key which matches this primary key. How do I do this to ensure the fk will be the same as the pk?

Thanks.

phranque

12:36 pm on Dec 6, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



can't answer about CF specifically but maybe this reference will give you some hints:
MySQL 5.0 Reference Manual :: How to Get the Unique ID for the Last Inserted Row [dev.mysql.com]

almo136

2:48 pm on Dec 6, 2009 (gmt 0)

10+ Year Member



thanks. thats what I needed.