Unable to connect to the database server.
" . "Error code " . mysql_errno() . ": " . mysql_error() . "
"; $errorCount++; } else { // verify the account belongs to the user $query = "SELECT * FROM account WHERE username='$userName' and accID='$fromAccountId'"; $result = queryMysql($query); // If result matched $myusername and $accountId, table rows must be 1 row $count = $result->num_rows; if($count == 1){ // record transfer to both accounts $sql2 = "UPDATE account SET balance=balance-'$amount' WHERE username='$userName' and accID='$fromAccountId'"; $result = queryMysql($sql2); $sql3 = "UPDATE account SET balance=balance+'$amount' WHERE accID='$toAccountId'"; $result = queryMysql($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."