dongmeirang4679 2014-03-17 20:03
浏览 41

如何使用存储在MySQL数据库中的图像链接在PHP中显示图像?

I have the image URL saved in my mySQL database.($imageid). How can I display images using their respective id? I want to display different images attached to different blog posts,as we see in regular blogs.

Thank you.

  • 写回答

1条回答 默认 最新

  • douxianxing5712 2014-03-17 20:05
    关注

    Unsure what stage you are, bit you need to query your 'table' for a single result, perhaps the ID? If the column was Imageid then you could display it like below in an array of results.

    $con=mysqli_connect("localhost","user","pass","my_db");
    
    $result = mysqli_query($con,"SELECT * FROM table");
    
    while($row = mysqli_fetch_array($result))
      {
      echo '<img src="' . $row['Imageid']  . '">';
      }
    
    mysqli_close($con);
    
    评论

报告相同问题?

悬赏问题

  • ¥15 三因素重复测量数据R语句编写,不存在交互作用
  • ¥15 微信会员卡等级和折扣规则
  • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表