Jump to content


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


Newly Inserted Record ID

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?


Share this post

Link to post
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)


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.