Jump to content


Newly Inserted Record ID

  • Please log in to reply
1 reply to this topic

#1 wynnewade

  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 30 April 2006 - 03:47 PM

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?


#2 toplay

  • Staff Alumni
  • Advanced Member
  • 973 posts

Posted 30 April 2006 - 05:32 PM

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)


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users