title: php Withdrawal code not working
body: <p>I have a personal project that needs fixing, please. The code below is supposed to withdraw an amount from workers account (debit the account) but it returns a blank space and displays an error. please i need assistance with the error or miss step as the case maybe. i am very new to php<br>
  here is my code</p>
  
  <pre><code>// connect db   
  &lt;?php
  $username="root";
  $server="localhost";
  $dbname="workers_db";
  $password="worded";
      $conn=mysql_connect($server,$username,$password);
      mysql_select_db($dbname) or die ("SERVER ERROR".mysql_error());
  ?&gt;
  
  // check
  &lt;?php
  if(isset($_GET['withdraw']))
  {
  
  $Req="SELECT * FROM balance";
  $query=mysql_query($Req);
  $nums=mysql_fetch_assoc($query);
  //echo $nums['CurrentB'];
  $amount=$_GET['amount'];
  $newB= ceil($nums['CurrentB']- $amount);
  ///////////////
  if($newB&gt;5000)
  {
  
  $amount=$_GET['amount'];
  $withdrawal="UPDATE balance SET CurrentB=$newB,LastWithdraw=$amount,date=now() WHERE b_id=1; ";
  $query2=mysql_query($withdrawal);
  //$nums=mysql_fetch_assoc($query2);
      if($query2)
      {
      $Req="SELECT * FROM balance";
      $query=mysql_query($Req);
      $nums=mysql_fetch_assoc($query);
      echo "Your new current account balance is". '  '.$nums['CurrentB'];
      echo "&lt;br/&gt;Your Last Withdrawal was ". '  '.$nums['LastWithdraw'];
      echo "&lt;br/&gt;Your Last Withdrawal Date was  on". '  '.$nums['date'];
      }
  }
  else
  {
  echo 'INSUFFICIENT BALANCE TO CONTINUE THIS TRANSACTION';
  }
  ///////////////
  }
  else
  {
  $Req="SELECT * FROM balance";
  $query=mysql_query($Req);
  $nums=mysql_fetch_assoc($query);
  echo "Your current account balance is". '  '.$nums['CurrentB'];
  }
  ?&gt;
  
  &lt;?php
  if(!isset($_GET['withdraw']))
  {
  ?&gt;
  //the form
  &lt;form action="&lt;?php  $_SERVER['PHP_SELF']; ?&gt;" method="GET" enctype="multipart/form-data"&gt;
  Amount to Withdraw: &amp;emsp;&lt;input type="text" name="amount"&gt;
  &lt;input type="Submit" name="withdraw" value="Proceed"&gt;
  &lt;/form&gt;
  &lt;?php
  }
  ?&gt;
  //end
  &lt;br/&gt;&lt;a href="index.php"&gt;EXIT&lt;/a&gt;
  </code></pre>