lilseeam Posted August 11, 2013 Share Posted August 11, 2013 Can someone please help me figure out how to store customer payment info into a databse. below is the sricpt i have written but i am not able to get the infomation into the database so i see the information for completed, pending, failed and cancel. $invoice->getStatus(); $invoice->getCustomData("ticketnum"); if($invoice->getStatus()=="completed") { $qry='update pcustomerorder set flag = "1" where pcustomerorderid ="'.$_SESSION["orderid"].'"'; $result=mysql_query($qry); header("Location: userprofile.php?msg=".$invoice->getStatus()); } /*else if($invoice->getStatus()=="pending") { $qry='update pcustomerorder set flag = "2" where pcustomerorderid ="'.$orderid.'"'; $result=mysql_query($qry); header("Location: userprofile.php?msg=".$invoice->getStatus()); }*/ else if($invoice->getStatus()=="canceled") { $qry='update pcustomerorder set flag = "0" where pcustomerorderid ="'.$_SESSION["orderid"].'"'; $result=mysql_query($qry); header("Location: userprofile.php?msg=".$invoice->getStatus()); } else if($invoice->getStatus()=="fail") { $qry='update pcustomerorder set flag = "0" where pcustomerorderid ="'.$_SESSION["orderid"].'"'; $result=mysql_query($qry); header("Location: userprofile.php?msg=".$invoice->getStatus()); } Link to comment https://forums.phpfreaks.com/topic/281053-issue-with-database/ Share on other sites More sharing options...
davidannis Posted August 11, 2013 Share Posted August 11, 2013 I would check the following: see what the getStatus function is returning. Make sure it is returning the expected value. You should see it in the URL that header sends you to. echo the $qry and try to run the SQL directly against the database (use phpMyadmin perhaps) and see if it executes correctly. Link to comment https://forums.phpfreaks.com/topic/281053-issue-with-database/#findComment-1444425 Share on other sites More sharing options...
davidannis Posted August 11, 2013 Share Posted August 11, 2013 Another couple of suggestions unrelated to your question: use the code tags around code you post in the forum (the <> symbol in the editor) in SQL use all CAPS for the reserved words like UPDATE, SET, WHERE (makes things easier to read) given a choice use mysqli instead of mysql Link to comment https://forums.phpfreaks.com/topic/281053-issue-with-database/#findComment-1444427 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.