Posts: 23
Name: Thomas
Location: Alberta, Canada
|
I'm attempting to make a table with one row and 3 columns (holding three different pictures in all.) I want each picture URL to be called from my database. When I use the following code, it places the same picture across the three columns and does this three times (creating three rows.) I want a different picture to be placed across the three columns and to have only one row. What can I do?
Here is the code:
$result = @mysql_query('SELECT image FROM specials');
$num=mysql_numrows($result);
$i = 0;
while ($i < $num) {
$image=mysql_result($result,$i,"image");
?>
<table>
<tr>
<td>
<img src="<? echo "$image"; ?>">
</td>
<td>
<img src="<? echo "$image"; ?>">
</td>
<td>
<img src="<? echo "$image"; ?>">
</td>
</tr>
<?
$i++;
}
echo "</table>";
?>
|