I'm new to php and mySQL and want to know how I connect to the db to retrieve some values from a couple of fields.
I want to be able to connect to my database table called whatnott_customer and retrieve the values stored in the fields 'startdate' and 'cycle'. But before it can retrieve those values it has to search for an order ID and then grab the values.
This is the script I'm using is this.
<?php
include"lpphp.php";
$mylpphp=new lpphp;
/* The first 5 parameters must be modified to reflect the
** information provided to you for YOUR store
**
** result should be set to LIVE when doing
** live transactions on [url]https://secure.linkpt.net[/url]
*/
$myorder["host"]="secure.linkpt.net";
$myorder["port"]="1129";
$myorder["storename"]="000000";
$myorder["keyfile"]="/location to .pem file";
$myorder["result"] = "LIVE";
/* These parameters are for test purposes only. In
** your implementation, they will reflect the information
** needed for your specific transactions
**
** NOTE: setting the test email address to your own email
** address will result in the receipt email being sent
** to you, which will help to know that the script is
** functioning properly.
*/
$myorder["cardNumber"]=$cardnumber;
$myorder["cvmvalue"]=$code;
$myorder["cvmindicator"]=$cvmindicator;
$myorder["cardExpMonth"]=$expMonth;
$myorder["cardExpYear"]=$expYear;
$myorder["name"]=$bname;
$myorder["email"]=$email;
$myorder["phone"]=$phone;
$myorder["address"]=$baddr;
$myorder["city"]=$bCity;
$myorder["state"]=$bState;
$myorder["zip"]=$bZip;
$myorder["country"]=$bCountry;
// periodic specific fields
$myorder["startdate"]=$date;
$myorder["periodicity"]=$cycle;
$myorder["installments"]=99;
$myorder["threshold"]=3;
$myorder["pbordertype"]="PbOrder_Modify";
$myresult=$mylpphp->ApproveSale($myorder); // send transaction
if ($myresult[statusCode] == 0) // transaction failed, print the reason
print "ApproveSale: statusMessage: $myresult[statusMessage]<br>\n";
else { // success
print "<pre>\n";
print "ApproveSale: statusCode: $myresult[statusCode]\n";
print "ApproveSale: AVSCode: $myresult[AVSCode]\n";
print "ApproveSale: trackingID: $myresult[trackingID]\n";
print "ApproveSale: orderID: $myresult[orderID]\n"; print "</pre>\n";
}
?>
So what I need to know how to do is once this script is called, it gets passed the orderID # to search for in the db. Once it finds that ID it grabs the values stored in 'startdate' and 'cycle' and puts them into the variables $startdate and $cycle to send over the gateway to our merchant to modify the billing account.
Hope someone can tell me how to do this.
Thanks