0

I have a database that stores the path to the users image such as images/profile/950baasfaa88c.jpg. Now when i try to put this into a variable and surround it with image tags, only a blank image comes up not the image itself...

    $profile_picture = $row['profile_image'];

<img src="'.$profile_picture.'" width=50 height=50 />

2 Answers2

2

you haven't echo PHP

<img src="'.$profile_picture.'" width=50 height=50 />

should be

<img src="<?= $profile_picture ?>" width=50 height=50 />
Loken Makwana
  • 3,788
  • 2
  • 21
  • 14
0

you need to echo out the value

<img src="<?php echo $row['profile_image']; ?>" width=50 height=50 />
Moss
  • 6,002
  • 1
  • 35
  • 40
Idrees Khan
  • 7,702
  • 18
  • 63
  • 111