I am trying to get this code to work that someone else wrote. This code has worked in the past, and hasn't been altered. I can't figure out where the problem is happening.
//****getting tax information *******//
if($TaxExempt == "no"){
$get_tax = mysql_query("SELECT * FROM shippinginfo WHERE userid = '$userid'");
if(!$get_tax){ echo mysql_error."error";}
$check_tax= mysql_num_rows($get_tax);
if($check_tax){
while($row = mysql_fetch_array($get_tax)){
foreach( $row AS $key => $val){
$$key = stripslashes($val);
}
session_register('SCity');
session_register('SCounty');
session_register('SState');
}//end while
}//end if
if($SState == "Oklahoma"){
$get_city = mysql_query("SELECT * FROM tax_city WHERE city = '$SCity'");
$check_city= mysql_num_rows($get_city);
if($check_city){
while($row = mysql_fetch_array($get_city)){
foreach( $row AS $key => $val){
$$key = stripslashes($val);
}
session_register('city_tax');
}//end while
}//end if
$get_county = mysql_query("SELECT * FROM tax_county WHERE County = '$SCounty'");
$check_county = mysql_num_rows($get_county);
if($check_county){
while($row = mysql_fetch_array($get_county)){
foreach( $row AS $key => $val){
$$key = stripslashes($val);
}
session_register('County_Tax');
}//end while
}//end if
$Tax = $city_tax + $County_Tax;
$Tax = $Tax * $TotalPriceArray;
$Tax = round($Tax*100)/100;
$TotalWithTax = $Tax + $TotalPriceArray + $ShippingPrice;
//print("Tax is $Tax");
$update_tax_info = mysql_query("UPDATE rates SET Tax = '$Tax' WHERE Invoice = '$Invoice' ");
if(!$update_tax_info){ echo mysql_error(); }
}
}