Hi,
Firstly the following code accomplishes the task that I require, although there is an error message that appears if there is no data in the database to populate the last data cell in the second column.
PHP:
[code=php]<table class=”main”>
<tr valign=”top”>
<td class=”maincell”>
<?php
$sql = ‘SELECT name, age, height FROM test’;
$result = mysql_query($sql) or die(mysql_error());
$iniLoop = 0;
$endLoop = mysql_num_rows($result);
while ( $iniLoop < $endLoop ) {
?>
<table class=”list”>
<tr valign=”top”>
<td class=”columnone”>
<span class=”image”>
<img src=”image.jpg” />
</span>
<span class=”data”>
<?php
echo mysql_result($result, $iniLoop, ‘name’);
print “<br>”;
echo mysql_result($result, $iniLoop, ‘age’);
print “<br>”;
echo mysql_result($result, $iniLoop, ‘height’);
?>
</span>
</td>
<td class=”columntwo”>
<span class=”image”>
<img src=”image.jpg” />
</span>
<span class=”data”>
<?php
echo mysql_result($result, $iniLoop+1, ‘name’);
print “<br>”;
echo mysql_result($result, $iniLoop+1, ‘age’);
print “<br>”;
echo mysql_result($result, $iniLoop+1, ‘height’);
?>
</span>
</td>
</tr>
</table>
<?php
$iniLoop += 2;
if ($endLoop <= $iniLoop+1) {
echo “<td></td>”;
}
}
?>
</td>
</tr>
</table>
The error message appears in a scenario such as this:
POPUPLATED || NOT POPUPLATED – ERROR MESSAGE APPEARS
The error message is:
[QUOTE]
Warning: mysql_result() [function.mysql-result]: Unable to jump to row 3 on MySQL result index 2 in /home/*****/public_html/test/testdisplay.php on line 134
Is anyone able to help with this issue ?
Many thanks in advance.