You have no accounts open.
";
} else {
echo "";
echo "
| Account Type |
Account Number |
Balance |
";
$num = $result->num_rows;
for ($j = 0; $j < $num; $j++){
$row = $result->fetch_array(MYSQLI_ASSOC);
echo "| " . $row['username'] . " | " . $row['acctype'] . " | $ " . number_format($row['balance'], 2, '.', ',') . " |
";
}
$result->close();
}
/*
if ($db_connect === FALSE)
echo "Unable to connect to the database server.
" . "Error code " . mysql_errno() . ": " . mysql_error() . "
";
else {
if (!@mysql_select_db($db_name, $db_connect))
echo "Connection error. Please try again later.
";
else {
*
*
$SQLstring = "SELECT * from account
WHERE username='$userName'";
*
$QueryResult = @mysql_query($SQLstring, $db_connect);
if (mysql_num_rows($QueryResult) == 0)
echo "You have no accounts open.
";
else {
echo "";
echo "
| Account Type |
Account Number |
Balance |
";
*
*
while (($Row = mysql_fetch_assoc($QueryResult)) !== FALSE)
{
echo "{$Row['accounttype']} | ";
echo "{$Row['accountid']} | ";
echo "{$Row['balance']} | ";
}
echo "
";
}
}
mysql_close($db_connect);
}
*
*/
//return ($retval);
}
$userName = "";
$userName = $_SESSION['login'];
echo "User Name: ".$userName."
";
showAccounts($userName);
?>