I am trying to place a while loop into a variable that I can use as a single echo. What is happening is that the loop is only displaying the first record.
All db connections are in place and connected. I would appreciate it if someone could point out my error. Many thanks
if (mysql_num_rows($result1) >0) {
$msgread = "";
while($row = mysql_fetch_array($result1)) {
$msgread = "<FONT COLOR='1d99f0'>" . "<b>" . $row['to_user'] . "</b>" . "</font>";
$msgread .= "<p />";
$msgread .= date("d/m/Y");
$msgread .= "<p />";
$msgread .= $row['message'];
$msgread .= "<p />";
$msgread .= $row['from_user'];
}
$error1 = false;
}
if($error1 == 0) {
echo $msgread;
}