
November 6th, 2012, 10:07 AM
|
|
Registered User
|
|
Join Date: Jun 2012
Posts: 17
Time spent in forums: 4 h 36 m 33 sec
Reputation Power: 0
|
|
|
Updating MySQL not working, but Sessions works fine
I am trying to update one of my tables to collect a number.
The Sessions portion works as expected, but nothing is being updated in the database.
PHP Code:
function shwAddTaxCertForm(){
$retBuffer = "";
$con = mysql_connect("xxxxxxxxx","xxxx","xxxxxxxx");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("xxxx", $con);
if(isset($_POST['Submit'])){
$location = mysql_real_escape_string($_POST['inpTaxCertNo']);
$tbl_name="ord_accounts";
$sql="UPDATE $tbl_name SET tax_exempt='$location' WHERE id='$accId'";
$result=mysql_query($sql);
}
$retCertCode = simpleQueryString(gine("inpTaxCertNo"), "");
if(!empty($retCertCode)){
if($retCertCode == "remove"){
$_SESSION['taxcert'] = "";
unset($_SESSION['taxcert']);
header("Location: ?action=ordconf");
die("Please continue to: <a href=\"?action=ordconf\">checkout</a>");
}
$retBuffer .= "
<p class=\"genPError\">
Tax cert received, please continue with your <a href=\"?action=ordconf\">checkout</a>.
</p>";
$_SESSION['taxcert'] = $retCertCode;
header("Location: ?action=ordconf");
}
$retBuffer .= "
<div class=\"checkoutPageWrapper\">
<h2>Florida Tax Exemption Certificate</h2>
<form action=\"?action=addtaxcert\" method=\"post\">
<div class=\"locListAnnot\" style=\"text-align: center;font-size: 1.15em;\">
To place an order with a Florida address without having sales<br />
tax added to your order's total, your company must provide an<br />
active Florida Resale or Exemption Certificate.<br />
<br />
Entries will be verified through the <a href=\"http://dor.myflorida.com/dor/gta.html\">Florida Department of Revenue</a><br />
website. Customers who's certificates can not be verified will be<br />
contacted to verify details before an order may ship.<br />
<br />
<span style=\"font-size: 0.8em;font-weight: bold;color: #2158A9;\">
<label for=\"inpTaxCertNo\">Florida Certificate Number:</label><br />
</span>
<input type=\"text\" value=\"\" name=\"inpTaxCertNo\" id=\"inpTaxCertNo\" />
<br />
</div>
<div class=\"locListAnnot\" style=\"text-align: center;font-size: 1.15em;\">
<br />
<input type=\"submit\" id=\"Submit\" name=\"Submit\" style=\"font-size: 1.15em\" value=\"Continue\" /><br />
<a href=\"?action=ordconf\">[Cancel]</a><br />
<br />
</div>
</form>
</div>";
return $retBuffer;
}
Any suggestions?
Thanks
|