Jump to content
Larry Ullman's Book Forums

Populating Orders Table Chapter 6


Recommended Posts

Dear Admin,

In chapter 6

The payment gateway that I am using want me to insert transaction id, amount , payment status to my order table before sending it to their payment gateway and on my thanks php they want me to compare the transaction_id returned from their site with the one in my database before the receipt is shown or printed.

please, where do I place the code : INSERT INTO orders (user_id, transaction_id, payment_status, payment_amount)  in my registration script before sending captured information to the payment processor?

Link to comment
Share on other sites

Thank you Bill.

 My problem is on how to insert into two tables simultaneously, I tried inserting into orders table after the line 100 in the registration.php which read $uid = mysqli_insert(dbc,q);

$_SESSION['reg_user_id'] = $uid; but it is not working.

You know what I need to know is how to insert into multiple table simultaneously. i.e users and orders table upon knowing the user_id

Link to comment
Share on other sites

Try to ensure program is connecting to database as a lot of problems are related to this. .This may not be relevant but are you creating your own reg script or is the code you are using direct from downloaded code from Larry's website? 

Link to comment
Share on other sites

Abiagail

I wrote the two queries, I would have posted it but this text editor does not allow to copy and paste I wouldn't know why it is preventing me from pasting? or is there any other way to paste on this particular text editor?

Link to comment
Share on other sites

I think those tables will populate after providing appropriate merchant information such as your login id and transaction key. Your book should explain how to set up payment gateway and how to fully test the site using credit card details. This is how 1st edition takes care of payment process.  As I do not have 2nd edition only the earlier 1st edition, I am unable to provide clarity as to how you can do it!  Sorry.

Link to comment
Share on other sites

 Share

×
×
  • Create New...