PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 7th, 2013, 05:37 AM
jonnyfreak jonnyfreak is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2012
Posts: 67 jonnyfreak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 h 54 m 55 sec
Reputation Power: 1
PHP-General - Update MYsql Database once results return from payment centre

i have a table in my database called CustOrders that has a column called "fulfilled". i have some code and variables that are passed back from the payment store but dont know how or where to add the UPDATE SQL statement with what i have been given,, to update the fulfilled column

the variable that needs to be inserted into the column is $StatusCode


Can anyone help please?

PHP Code:
<div class="<?= $MessageClass ?>">
          <
div class="TransactionResultsItem">
                    <
div class="TransactionResultsLabel">Payment Processor Response:</div>
                    <
div class="TransactionResultsText">
                              <?= 
$Message ?>
                    </div>
          </div>
 
 
<?php if ($DuplicateTransaction == true) { ?>
          <div style="color:#000;margin-top:10px">
                    A duplicate transaction means that a transaction with these details
                    has already been processed by the payment provider. The details of
                    the original transaction are given below
          </div>
          <div class="TransactionResultsItem" style="margin-top:10px">
                    <div class="TransactionResultsLabel">
                              Previous Transaction Response:
                    </div>
                    <div class="TransactionResultsText">
                              <?= $PreviousTransactionMessage ?>
                    </div>
          </div>
<?php ?>
<div style="margin-top:10px">
<hr/>
<?php
echo "<strong>Variables Passed Back From The Gateway</strong>";
echo 
"<hr/>";
echo 
"Message: " $Message "<br/>";
echo 
"Status Code: " $StatusCode "<br/>";
echo 
"Previous Status Code: "$PreviousStatusCode "<br/>";
echo 
"Previous Message: " $PreviousMessage "<br/>";
echo 
"Cross Referrence: " $CrossReference "<br/>";
echo 
"Card Type: " $CardType "<br/>";
echo 
"Card Class: " $CardClass "<br/>";
echo 
"Card Issuer: " $CardIssuer "<br/>";
echo 
"Card Issuer Country Code: " $CardIssuerCountryCode "<br/>";
echo 
"Amount: " $Amount "<br/>";
echo 
"Currency Code: " $CurrencyCode "<br/>";
echo 
"Order ID: " $OrderID "<br/>";
echo 
"Transaction Type: " $TransactionType "<br/>";
echo 
"Transaction Date Time: " $TransactionDateTime "<br/>";
echo 
"Order Description: " $OrderDescription "<br/>";
echo 
"Customer Name: " $CustomerName "<br/>";
echo 
"Address Line 1: " $Address1 "<br/>";
echo 
"Address Line 2: " $Address2 "<br/>";
echo 
"Address Line 3: " $Address3 "<br/>";
echo 
"Address Line 4: " $Address4 "<br/>";
echo 
"City: " $City "<br/>";
echo 
"State: " $State "<br/>";
echo 
"PostCode: " $PostCode "<br/>";
echo 
"Country Code: " $CountryCode "<br/>";
echo 
"Email Address: " $EmailAddress "<br/>";
echo 
"Phone Number: " $PhoneNumber "<br/>";
echo 
"<hr/>";
?>
 
 
</div>
 
 
          <div style="margin-top:10px">
                    <a href="index.html">Process Another</a>
          </div>
</div>
 
<!-- Database update using PHP -->
<?php
/*
$host="";
$user="";
$password="";
 
 
$database_connection = mysql_connect($host,$user,$password);
if (!$database_connection)
  {
  die('Could not connect: ' . mysql_error());
  }
 
 
if ($StatusCode == "0")
{
// Update database for successful transaction (status, stock etc)
}
else
{
// Update database for Failed transaction
}
*/
?> 

Reply With Quote
  #2  
Old February 7th, 2013, 06:27 AM
Jacques1's Avatar
Jacques1 Jacques1 is online now
pollyanna
Click here for more information.
 
Join Date: Jul 2012
Location: Germany
Posts: 1,873 Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 2 Days 2 h 24 m 6 sec
Reputation Power: 813
Hi,

not sure how we're supposed to help you. Obviously you do know where to do the update, because you have a comment there. So is it a problem with the query syntax? A question about how exactly the query should work?

Reply With Quote
  #3  
Old February 7th, 2013, 06:45 AM
jonnyfreak jonnyfreak is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2012
Posts: 67 jonnyfreak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 h 54 m 55 sec
Reputation Power: 1
Quote:
Originally Posted by Jacques1
Hi,

not sure how we're supposed to help you. Obviously you do know where to do the update, because you have a comment there. So is it a problem with the query syntax? A question about how exactly the query should work?


yes its the actual syntax that i am unsure of

thanks

Reply With Quote
  #4  
Old February 7th, 2013, 09:07 PM
E-Oreo's Avatar
E-Oreo E-Oreo is offline
Lost in code
Click here for more information.
 
Join Date: Dec 2004
Posts: 7,944 E-Oreo User rank is General 91st Grade (Above 100000 Reputation Level)E-Oreo User rank is General 91st Grade (Above 100000 Reputation Level)E-Oreo User rank is General 91st Grade (Above 100000 Reputation Level)E-Oreo User rank is General 91st Grade (Above 100000 Reputation Level)E-Oreo User rank is General 91st Grade (Above 100000 Reputation Level)E-Oreo User rank is General 91st Grade (Above 100000 Reputation Level)E-Oreo User rank is General 91st Grade (Above 100000 Reputation Level)E-Oreo User rank is General 91st Grade (Above 100000 Reputation Level)E-Oreo User rank is General 91st Grade (Above 100000 Reputation Level)E-Oreo User rank is General 91st Grade (Above 100000 Reputation Level)E-Oreo User rank is General 91st Grade (Above 100000 Reputation Level)E-Oreo User rank is General 91st Grade (Above 100000 Reputation Level)E-Oreo User rank is General 91st Grade (Above 100000 Reputation Level)E-Oreo User rank is General 91st Grade (Above 100000 Reputation Level)E-Oreo User rank is General 91st Grade (Above 100000 Reputation Level)E-Oreo User rank is General 91st Grade (Above 100000 Reputation Level)  Folding Points: 945 Folding Title: Novice Folder
Time spent in forums: 2 Months 10 h 16 m 54 sec
Reputation Power: 7053
The general syntax for a database update is:
Code:
UPDATE table SET column1 = value1 WHERE column2 = value2


Where each word in lowercase would be replaced by something that reflects your actual database structure and variable values.

Remember that string values must be surrounded by apostrophes, and all values must be passed through mysql_real_escape_string.

column1 and value1 are respectively the column that you want to change and the value that you want to set the column to.

columne2 and value2 are the column and value that uniquely identify the row that you want to update.
__________________
PHP FAQ
How to program a basic, secure login system using PHP
Connect with me on LinkedIn


Quote:
Originally Posted by Spad
Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around

Reply With Quote
  #5  
Old February 8th, 2013, 04:09 AM
Jacques1's Avatar
Jacques1 Jacques1 is online now
pollyanna
Click here for more information.
 
Join Date: Jul 2012
Location: Germany
Posts: 1,873 Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 2 Days 2 h 24 m 6 sec
Reputation Power: 813
... or simply read the manual or one of the many, many tutorials.

I mean, the syntax of (My)SQL isn't exactly secret knowledge.

Reply With Quote
  #6  
Old February 8th, 2013, 05:25 AM
jonnyfreak jonnyfreak is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2012
Posts: 67 jonnyfreak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 h 54 m 55 sec
Reputation Power: 1
Quote:
Originally Posted by Jacques1
... or simply read the manual or one of the many, many tutorials.

I mean, the syntax of (My)SQL isn't exactly secret knowledge.


thanks for you input

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > PHP-General - Update MYsql Database once results return from payment centre

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap