title: Transferring values from one database field to another through a php site not working in one instance
body: <p>We have a system on our website wherein you can have multiple accounts and earn points on each. Those points you can transfer between the accounts on this webpage that I've noticed an error on. Basically, if I have a certain combination of accounts, namely a first and second, it won't let me transfer, it'll just say "Please fill in with a number.". If I have a first and third or all three, it works fine. I've been looking through it for about two hours now and can't find what isn't working... any help would be IMMENSELY appreciated :D</p>
  
  <pre><code>  &lt;?php if($a == "exchange")
  
    {
    $GetUserInfo = mysql_query("SELECT * FROM members WHERE id = '$userid'") or die(mysql_error());
  
      $GetUserInfo = mysql_fetch_object($GetUserInfo);
  
      $cols = 1; //determines colspan
      $status = 1;
  
      $GetMultipleInfo = mysql_query("SELECT * FROM members WHERE id = '".$GetUserInfo-&gt;mult_uid."'") or die(mysql_error());  
        if(mysql_num_rows($GetMultipleInfo) != 0)
        {
          ++$cols;
          ++$status;
        }
        $GetMultipleInfo = mysql_fetch_object($GetMultipleInfo);
  
  
  
      $GetAdMultipleInfo = mysql_query("SELECT * FROM members WHERE id = '".$GetUserInfo-&gt;mult_admin."'") or die(mysql_error());
        if(mysql_num_rows($GetAdMultipleInfo) != 0)
        {
          ++$cols;
          $status = ($status == 2 ? 4 : 3);
        }
        $GetAdMultipleInfo = mysql_fetch_object($GetAdMultipleInfo);
  
  
  // Sparks Transfer
  if (isset($_POST['spartrans']))
  {
    $order = $_POST['sparrecipients'];
  
  if ($order == 'first')
  {
    $tpoints2 = $_POST['tpoints2'];
    $tpoints3 = $_POST['tpoints3'];
    $tpoints = $tpoints2 + $tpoints3;
  
     if ($status == 2)
        if ((!is_numeric($tpoints1)) || (!is_numeric($tpoints2)) || empty($tpoints1) ||  empty($tpoints2))
          message("Please fill in with a number.","Enchanted Hogwarts","$PHP_SELF?a=exchange");
    elseif ($status == 3)
        if ((!is_numeric($tpoints1)) || (!is_numeric($tpoints3)) || empty($tpoints1) || empty($tpoints3))
          message("Please fill in with a number.","Enchanted Hogwarts","$PHP_SELF?a=exchange");
    elseif ($status == 4)
        if ((!is_numeric($tpoints1)) || (!is_numeric($tpoints2)) || (!is_numeric($tpoints3)) || empty($tpoints1)  ||  empty($tpoints2) || empty($tpoints3))
          message("Please fill in with a number.","Enchanted Hogwarts","$PHP_SELF?a=exchange");
  
    if ($tpoints2 &gt; $GetMultipleInfo-&gt;tpoints)
      message("" . getName($GetMultipleInfo-&gt;id) . " does not have enough sparks.","Enchanted Hogwarts","$PHP_SELF?a=exchange");
  
    if ($tpoints3 &gt; $GetAdMultipleInfo-&gt;tpoints)
      message("" . getName($GetAdMultipleInfo-&gt;id) . " does not have enough sparks.","Enchanted Hogwarts","$PHP_SELF?a=exchange");
  
    if ($GetUserInfo-&gt;mult_uid != 0)
      mysql_query("UPDATE members SET tpoints = GREATEST(tpoints - $tpoints2,0) WHERE id = '".$GetMultipleInfo-&gt;id."'") or die(mysql_error());
    if ($GetUserInfo-&gt;mult_admin != 0)
      mysql_query("UPDATE members SET tpoints = GREATEST(tpoints - $tpoints3,0) WHERE id = '".$GetAdMultipleInfo-&gt;id."'") or die(mysql_error());
    mysql_query("UPDATE members SET tpoints = GREATEST(tpoints + $tpoints,0) WHERE id = '$userid'") or die(mysql_error());
  
    message("Successfully transferred $tpoints Sparks to ".getName($userid).".","Enchanted Hogwarts","$PHP_SELF?a=exchange");
  }
  
  }
  
  }
  ?&gt;
  </code></pre>