Jump to content

Archived

This topic is now archived and is closed to further replies.

youngbuc

mysql_insert_id()

Recommended Posts

i have a db with 4 tables.

-main

-customers

-power

-connections

 

i am trying to create a form that inserts data into the "main" and "customer" tables. in the MAIN table, the cust_id is set to auto increment. i would like to my form to send the "cust_id" that was just created to the next step of the form or just add it to the next table. 1st form would have 4 fields from the table "main" - cust_id, tenant, environment, and size. cust_id would be set to 0 or null, then when they submit, it would send them to the second form that has fields from "customers" - cust_id (this is where i want to find out what the cust_id was created for the first table),contact, phone, fax and so on. any help would be great.

Share this post


Link to post
Share on other sites

You will need to hand code this as dreamweaver lacks abillity to insert code to grab lastinserted id. mySQL websitehas relevant info on last id, and the rest you can pass as parameters.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.