Jump to content

generating "order id" before entering data


jrobles

Recommended Posts

I am working on a credit card  processing script and need to send the orderID to the payment gateway so the gateway can send the order id in the response page. my script uses an simple if statement

 

if(FORM ISNT POSTED)
{INSERT DATA INTO MYSQL TABLE(S)}
else
{SHOW FORM}

 

In the form I can have a hidden field called oid (OrderID) How can I populate that value with what the order ID is going to be before I insert the records into the order table? I am pretty sure I have to have some code before the IF that will generate the next id from the table but Im not sure what the function is to do that.

 

thanks

from what i understand you should first layout your logical process for an

order

you can create :

1. create an insert form with initial order details request etc and submit

2. pass  the GET the  parameter by SELECT LAST_INSERT_ID();(the last inserted orderid if it's an orders_list to the hidden field

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.