scmeeker Posted August 19, 2010 Share Posted August 19, 2010 I have a series of steps a user goes through to add a product. I'm having a problem with the first going to second page. The first page is a form to input information which has a "add" php file that goes with it that basically Posts and Inserts the information into the table, then moves on to the next page. It also auto increments a new id for the product in the table during this process. The problem is I'm trying to get the product id to carry over to the next page so they can review the information they just input. Any ideas on how I can pull that new id by going from that one page to the next with that move (Form>Insert(form action)>EditPage)? I'm just having a hard time visualizing this because I'm inserting the new product then there's nothing to reference because I can't pinpoint on the id yet. Quote Link to comment https://forums.phpfreaks.com/topic/211197-problem-with-add-then-select/ Share on other sites More sharing options...
Pikachu2000 Posted August 19, 2010 Share Posted August 19, 2010 After the INSERT queryin the first script, you can call mysql_insert_id(), and store its value in a hidden field or $_SESSION var for use in the next script. Quote Link to comment https://forums.phpfreaks.com/topic/211197-problem-with-add-then-select/#findComment-1101332 Share on other sites More sharing options...
scmeeker Posted August 19, 2010 Author Share Posted August 19, 2010 Worked perfect! Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/211197-problem-with-add-then-select/#findComment-1101373 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.