从数据库中检索图像并在页面上显示所有图像 [英] retrieving images from database and displaying all on a page

查看:130
本文介绍了从数据库中检索图像并在页面上显示所有图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有5个附件,其路径存储在database(5)列中。我正在检索第一个文件的路径如下。

I have 5 attachments whose paths are stored in database (5) columns. I am retrieving the paths as follows for the first file.

$path1=$rowArray['file1'];
$path2=$rowArray['file2'];
<?php printf('<a href="%s" >View all Files</a>',$path1); ?>

其中 $ path1 是路径第一个文件,通过单击查看所有文件,图像显示在下一页。

where $path1 is the path of the first file, and by clicking on View all Files, the image is shown on the next page.

我想在查看全部显示同一页面上的所有5个图像文件链接。

I want to show all the 5 images on the same page under View all Files links.

我该怎么做。希望你们都明白。我已经应用了一个循环来显示它们,但它没有帮助。请为我提供一个有效的解决方案。

How can i do it. Hope u all understand. I have applied a loop to show, them all, but it doesnot help. Please provide me a valid solution for this.

推荐答案

毫无疑问,你不能按照你想要的方式去做,只需一个链接,显示你的所有图像。我想最好的方法是在你的URL上发送文件名或id并在你的目标PHP上检查它,这样就可以显示它们。

No doubt you cannot do it the way you want, with one link, show all your images. I guess the best way to do it is to send the file names or ids on your URL and check for it on your target PHP, this way you can show them.

这篇关于从数据库中检索图像并在页面上显示所有图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆