Subtract From and Update mysql database field via php

Hello Peeps,
I am trying to do the following

  1. receive input via a form
  2. From the submitted variables, check the email in the database table and then pick the number field i want to subtract from
  3. subtract the value from the submitted form from the value in the amount field in the database (I want to verify that the submitted value is less than the value in the database field)
  4. Update the database with the value of the subtraction…
  5. redirect to another page

I have written a script and when i run it, it does nothing… I need experienced php programmers to please take a look and modify if necessary… Thank you for your time and kind consideration…
The script is below

<?

$host=“localhost”; // Host name
$username=“root”; // Mysql username
$password=“”; // Mysql password
$db_name=“”; // Database name

//Connect to server and select databse.
mysql_connect(“$host”, “$username”, “$password”)or die(“cannot connect to server”);
mysql_select_db(“$db_name”)or die(“cannot select DB”);

// value sent from form
$AccName=$_POST[‘AccName’];
$BrwAccNo=$_POST[‘BrwAccNo’];
$Email=$_POST[‘Email’];
$AmtTransferred=$_POST[‘AmtTransferred’]
$BAName=$_POST[‘BAName’];
$BName=$_POST[‘BName’];
$RName=$_POST[‘RName’];
$Swt=$_POST[‘Swt’];
$BccNumber=$_POST[‘BccNumber’];
$BLocation=$_POST[‘BLocation’];

// table name
$tbl_name=client;

// retrieve password from table where e-mail = $Email(mark@phpeasystep.com)
$sql=“SELECT account_balance FROM $tbl_name WHERE email=‘$Email’”;
$query=mysql_query($sql);
$result=mysql_fetch_row($query);
$val=$_POST[‘AmtTransferred’];
$new_val=$result-$val;
mysql_query(“UPDATE client SET account_balance = ‘$new_val’ WHERE email=‘$Email’”);

header(“Location: Processingpage1.htm”);

?>

Edit/Delete Message

you just need to do some basic debugging.

this is twice as inefficient as it needs to be

you don’t have to retrieve the balance first before updating it, you can just update it

UPDATE client 
   SET account_balance = account_balance - $_POST['AmtTransferred'];