Its meant to load 3 messages i would use a while loop but that is beyond my skill level so for now im using a really bad method but it should work none the less... and half of it does but the other won't.
I have 2 messages in the database and my code is only loading the 2nd message but not the first even though it should be loading the first message in the database if the 2nd one is loading ....
Also one other small problem is the for message 2 username doesn't load up...im not sure what to do from here... any help is much appreciated:
Code:
<?include("include.php");
$GetLetters = mysql_query("SELECT * FROM messages WHERE reciever='$_SESSION[Current_User]'");
if (!($row = mysql_fetch_assoc($GetLetters))) {
header("Location: letterbox.php");
die;
}
Else{
include("energybarinclude.php");
$Subject = $row['Subject'];
$From = $row['Sender'];
$SentOn = $row['Senttime'];
$MessageOne = $row['MessageText'];
$FindUser1 = mysql_query("SELECT * FROM userregistration WHERE UserID='$From'");
//Fetch the row from the database
$rowuser = mysql_fetch_assoc($FindUser1);
$UserName1 = $rowuser['UserName'];
$rowtwo = mysql_fetch_assoc($GetLetters);
$Subjecttwo = $rowtwo['Subject'];
$Fromtwo = $rowtwo['Sender'];
$SentOntwo = $rowtwo['Senttime'];
$MessageTwo = $rowtwo['MessageText'];
$FindUser2 = mysql_query("SELECT * FROM userregistration WHERE UserID='$Fromtwo'");
// Fetch the row from the database
$row2 = mysql_fetch_assoc($FindUser2);
$UserName2 = $row2['UserName'];
?>

