Error code " . mysql_errno() . ": " . mysql_error() . "
"; $errorCount++; } else { if (!@mysql_select_db($db_name, $db_connect)) { $errorMessage .= "Connection error. Please try again later.
"; $errorCount++; } else { // verify the account belongs to the user $sql = "SELECT * FROM account WHERE username='$userName' and accountid='$fromAccountId'"; $result = mysql_query($sql); // If result matched $myusername and $accountId, table rows must be 1 row $count = mysql_num_rows($result); if($count == 1){ // record transfer to both accounts $sql2 = "UPDATE account SET balance=balance-'$amount' WHERE username='$userName' and accountid='$fromAccountId'"; $result = mysql_query($sql2); $sql3 = "UPDATE account SET balance=balance+'$amount' WHERE accountid='$toAccountId'"; $result = mysql_query($sql3); $errorMessage .= "Transfer completed.
"; } else { $errorCount++; $errorMessage .= "Invalid user name/account number.Please re-enter the form information below.
\n"; displayForm (); } else { if ($showForm == TRUE) { displayForm(); // new page load } else { // make transfer transfer($userName,$fromAccountNumber,$toAccountNumber,$amount); echo $errorMessage."