Problem of loop execution

I write some html code into a php variable. but in this html code i coudn’t execute loop on a particular portion. so that i declare this loop another php variable and final result of this loop is kept on the variable and this variable i put into main portion of html code but this is not working.

[B]//query which fetch row from database
while($row1= mysql_fetch_assoc($result)) {
$test_title=$row_test[‘title’];
$test_value=$row_test[‘value’];
$output=<<<_
<tr>
<td width=“37%” align=“left” valign=“top” border=“0”><strong>   $test_title</strong></td>
<td align=“left” valign=“top” border=“0” width=“63%”><strong>: </strong>   $test_value     </td>
</tr>
_;

$rowoutput1 = $rowoutput;
$rowoutput2.= $rowoutput1;
} [/B]

[B]$a="<!DOCTYPE html PUBLIC ‘-//W3C//DTD XHTML 1.0 Transitional//EN’ ‘http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd’>
<html xmlns=‘http://www.w3.org/1999/xhtml’>
<head>
<meta http-equiv=‘Content-Type’ content=‘text/html; charset=utf-8’ />
<title></title>
</head>
<body>

<table width=‘600’ border=‘0’ cellspacing=‘0’ cellpadding=‘0’ >
“.$output.”
</table>
</body>
</html>";[/B]

But this is not working. can anyone help me about this.

You may use the following options:

//query which fetch row from database
while($row1= mysql_fetch_assoc($result)) {
$test_title=$row_test[‘title’];
$test_value=$row_test[‘value’];
$output.=‘<tr>
<td width=“37%” align=“left” valign=“top” border=“0”><strong>   $test_title</strong></td>
<td align=“left” valign=“top” border=“0” width=“63%”><strong>: </strong>   $test_value     </td>
</tr>’;
}

<!DOCTYPE html PUBLIC ‘-//W3C//DTD XHTML 1.0 Transitional//EN’ ‘http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd’>
<html xmlns=‘http://www.w3.org/1999/xhtml’>
<head>
<meta http-equiv=‘Content-Type’ content=‘text/html; charset=utf-8’ />
<title></title>
</head>
<body>

<table width=‘600’ border=‘0’ cellspacing=‘0’ cellpadding=‘0’ >
<?php print $output; ?>
</table>
</body>
</html>

or

<!DOCTYPE html PUBLIC ‘-//W3C//DTD XHTML 1.0 Transitional//EN’ ‘http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd’>
<html xmlns=‘http://www.w3.org/1999/xhtml’>
<head>
<meta http-equiv=‘Content-Type’ content=‘text/html; charset=utf-8’ />
<title></title>
</head>
<body>

<table width=‘600’ border=‘0’ cellspacing=‘0’ cellpadding=‘0’ >
<?php
//query which fetch row from database
while($row1= mysql_fetch_assoc($result)) {
$test_title=$row_test[‘title’];
$test_value=$row_test[‘value’];
?>
<tr>
<td width=“37%” align=“left” valign=“top” border=“0”><strong>   <?php print $test_title; ?></strong></td>
<td align=“left” valign=“top” border=“0” width=“63%”><strong>: </strong>   <?php print $test_value; ?>     </td>
</tr>
<?php
}
?>

</table>
</body>
</html>