简体   繁体   English

无法以Xampp显示图像

[英]Cant display images in xampp

In my code I store image names in the database and I try to retrieve images from a folder on my localhost. 在我的代码中,我将图像名称存储在数据库中,然后尝试从本地主机上的文件夹中检索图像。 The folder is inside the htdocs. 该文件夹位于htdocs中。 I tried banner(foldername)/ and http://localhost/banner/ nothing helped. 我尝试了banner(foldername)/和http:// localhost / banner /没有任何帮助。 Below is my code- 以下是我的代码-

$output .= '
   <img src="http://localhost/banner/'.$row["banner_image"].'" alt="'.$row["banner_title"].'" />

the screenshot of db db的屏幕截图 在此处输入图片说明

screenshot of filestructure filestructure 文件结构的屏幕快照

banner folder screenshot banner folder screenshot of the code u asked to run code 横幅广告文件夹截图横幅广告文件夹截图您要求运行代码的代码

maybe problem is in your path image in phpmyadmin 也许问题出在phpmyadmin中的路径图像中

try update using sql 尝试使用sql更新

UPDATE `banner` SET `banner_image` = 'http://localhost/banner/banner1.jpg' WHERE `banner`.`banner_id` = 1;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM