Jump to content

[SOLVED] Getting the ID Field for a customer while it is Inserting


bri0987

Recommended Posts

Table: "ORDERS"

 

The Order_ID field for the table "Orders" is also the Invoice Number for the Customer and is set to auto_increment.

 

The problem I am having:

 

When a customer successfully completes the checkout process (in a custom made shopping cart).

PHP INSERTS the customers order information into the MySQL Database table "Orders".

 

The "Thank You Page" for the customer will need to display the Invoice (Order_ID) number to the customer for their reference and to track their order online.

 

I was going to just use PHP and pull the last created Order_ID number and display it to the customer BUT I found that if bandwidth is low and multi customers are ordering at the same time, some customers WILL get other customer Order information... This is BAD.

 

How can I get the Order_ID field that I am currently INSERTing into and capture the ID field and set it into a $_session so that I can display the RIGHT Order_ID to the RIGHT Customer?

 

Any help on this topic will be useful.

 

 

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.