Jump to content

Newly Inserted Record ID


wynnewade

Recommended Posts

I have a multi-part submission form for a support application for us, the manufacturer - the reseller's information is submitted, the customer's information is submitted, then the warranty support information needs to be submitted.

How can I retrieve the CustomerID after I insert a record into the customer table in mySQL and pass it to the CSQdetails.php page?

Thanks,
Jon
Link to comment
Share on other sites

Right after you insert the customer id use:

[a href=\"http://us2.php.net/manual/en/function.mysql-insert-id.php\" target=\"_blank\"]http://us2.php.net/manual/en/function.mysql-insert-id.php[/a]


As for passing something onto another page, the usual options apply depending on your needs and security concerns:

pass value through the URL (GET method)
through hidden field (when using forms. GET or POST method)
save in a cookie
save manually in a file on server and then read it
in memory (if host allows it and using Linux)
save in PHP sessions (IMO, this is the best choice)

hth.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.