MySql, PHP display Picture on HTml

前端 未结 3 1910
死守一世寂寞
死守一世寂寞 2021-01-29 10:43

im trying to display the picture saved in the database using Php, but what i get is Url link which was saved in the database and not the picture, i think the syntax is wrong.

相关标签:
3条回答
  • 2021-01-29 11:00

    You need to construct an <img> element, not just output the image URL.

    Try replacing this: $row['ImageURL']

    With this: "<img src='".$row['ImageURL']."' />

    0 讨论(0)
  • 2021-01-29 11:17

    On this line:

    echo "<td>" .$row['ImageURL'] ."</td>";

    it looks like you'll want that to be:

    echo "<td><img src='" .$row['ImageURL'] ."' /></td>";

    0 讨论(0)
  • 2021-01-29 11:21

    Change

    echo "<td>" .$row['ImageURL'] ."</td>";
    

    to

    echo "<td><img src='" .$row['ImageURL'] ."' style='width: 200px; height: 350px;' /></td>";
    

    Modify the values 200px and 350px to whatever you want, just keep the 'px' suffix.

    0 讨论(0)
提交回复
热议问题