I am trying to show an image in a looping table. I would like to display the image connected with each ID in a field on my table. Here is my code
while($row= mysql_fetch_array($result))
{
$list .= "<tr>";
$list .= "<td>".$row["year"]."</td>";
$list .= "<td>".$row["Make"]."</td>";
$list .= "<td>".$row["spec"]."</td>";
$list .= "<td>".$row["miles"]."</td>";
$list .= "<td>".$row["price"]."</td>";
$list .= "<td>".$row["<img src="getdata.php3?id=$row["id"]"]."</td>";
$list .= "</tr>";
}
Display images in looping table
Moderator: General Moderators
-
yeo_yeo2000
- Forum Newbie
- Posts: 6
- Joined: Fri Oct 22, 2004 9:26 am
-
yeo_yeo2000
- Forum Newbie
- Posts: 6
- Joined: Fri Oct 22, 2004 9:26 am
-
yeo_yeo2000
- Forum Newbie
- Posts: 6
- Joined: Fri Oct 22, 2004 9:26 am
Code: Select all
$list .= "<td><img src='getdata.php3?id=".$row['id']."'</td>";-
yeo_yeo2000
- Forum Newbie
- Posts: 6
- Joined: Fri Oct 22, 2004 9:26 am
you could also have done
by escaping the quotes that need to be there for the img src
Code: Select all
<?php
$list .= "<td><img src="getdata.php3?id="".$row['id'].""></td>";
?>