i needed to fetch some names and image of vegetable from my database and since saving image from mysql table and then retrieving it on web page is a bad idea, i have the images saved in the images/vegetable folder within the workspace. i am working on cloud9 and using the following code snippet:
while($row = mysqli_fetch_array($result)) {
echo "<tr>";
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['price'] . "</td>";
$images_src="/images/vegetable/".$row['name'].".jpg";
// echo "<td>" .$images_src ."</td>"; //this displays the image src correctly
echo "<td> <img src=$images_src ></img> </td>";
echo "</tr>";
}
echo "</table>";
however after execution it displays the broken image icon. where am i going wrong? is achieving image source this way illegal?