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.

 

 

mysql_insert_id(); is what I was using when I got that bad problem with some customers getting other customer order details... because they were ordering at the same time.

 

> Also what do you mean when you said "it's void do not put the..."

Archived

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

×
×
  • 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.