First of all, if you want to use an iframe, you need an actual page which can be loaded into the iframe. The simplest way to do this is to make a page which fetches the review content of any of the reviews.
As per how to echo content, when you're incorporating variables into the string i much prefer lee's original method. Popping in and out of php mode is both messy and probably less efficient.
Also, mysql_result should only be used if you want a specific field. in your case, as you're using them all you can use mysql_fetch_array. This function returns false when you run out of rows, which saves you doing the count too.
Anyway... here is my revised version of the code. Because of the iframe it's split into two pages:
first of all the original page:
code:
<?
$username="*****";
$password="*****";
$database="*****";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM reviews";
$result=mysql_query($query);
mysql_close();
?>
<b><center>Review List</center></b><br><br>
<table border=0>
<tr><td>
<table border=0>
<?
while ($row = mysql_fetch_array($result)) {
echo '
<tr>
<td>
<a href="iframe.php?id=' . $row['id'] . '" target="iframe">' . $row['Title'] . '</a>
</td></tr>';
}
?>
</table>
</td>
<td>
<iframe name="iframe" src="about:blank" width="400" height="300"></iframe>
</td>
</tr>
</table>
The html layout you started seemed a bit confusing. I've redone it the way I think you mean... change it back if it was meant to be different in the context of a whole page.
Then you have iframe.php which goes a little bit like this:
code:
<?
$username="*****";
$password="*****";
$database="*****";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT Review FROM reviews WHERE id = $_GET[id]";
$result=mysql_query($query);
mysql_close();
echo mysql_result($result, 0);
?>