email a customer their new order number

Hello all,

I am finishing up an order form, the last step is to email the content to the owner and customer if the customer supplied an email adress. This is easy enough to do with PHP or I can use some app like sendmail. my issue is that I want the customer to know the ordernumber that is set in the linked mysql DB to auto incriment. since this data is not entered in the order form how can i get this from the DB? The order number is the primary key, all other data such as name and address could be in the database already so i cant simply search for a similar order. Any help would be appreciated.

If you execute mysql_insert_id() ( http://us.php.net/mysql_insert_id ) After you have done the insert of the order, it will return the Auto Incremented id.

Thank you very much for the quick help. I was on vacation last week I appologize for the delay, this worked perfectly for my needs. =)

Glad I could help… Ironically enough, I needed to do a very similar things only days before you asked.

Any way, like I said Glad to help.

Sponsor our Newsletter | Privacy Policy | Terms of Service