I'm trying to figure out if I can have an if while loop in an if else statement. Can this be done?
Here's the code with the position of the if while marked ********
<?
$acresult = mysql_query("SELECT * FROM account WHERE username LIKE '$username' AND password LIKE '$password'",$db);
if ($acrow = mysql_fetch_array($acresult)) {
$amount = ($acrow[amount]);} else {}
$result = mysql_query("SELECT * FROM users WHERE username LIKE '$username' AND password LIKE '$password'",$db);
if ($myrow = mysql_fetch_array($result)) {
$name = ($myrow[fullname]);
printf ("Balance: \$$amount<br>
//This is where I want to put the if while loop to list keywords in the database and the amount.
");
} else {
printf ("$name, Your Session Has Expired");
}
?>