This question already has an answer here:
I made this code to display an image. The link to the image is in the database and the image is stored in a folder called uploads in the root. I am getting a broken image displayed back but no error. Any help would be much appreciated. thanks
$sql= "SELECT image FROM images";
$res= mysql_query($sql);
while($row=mysql_fetch_array($res))
{
echo("<td><img src=/uploads/". $row['image'] ." width = 100</td><br>");
}
</div>
Change that echo line to this...
echo("<td><img src='/uploads/". $row['image'] ."' width=100 ></td>");
You were missing single quotes, and closing >
Also you shouldn't have a < br > after a < / td >, it would usually just be another < td > after
Ive taken it out
EDIT
You were echoing uploads folder twice...once in the img and once from the database. This should work, using only the database value...since you stored with the 'uploads/' folder already attached.
echo("<td><img src='". $row['image'] ."' width=100 ></td>");