retrieving images from database and displaying all on a page

你离开我真会死。 提交于 2019-12-02 15:11:57

问题


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); ?>

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

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.


回答1:


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.




回答2:


you need javascript for that, an hover on the links would create a div with the image/s which src attribute would be the link's path..



来源:https://stackoverflow.com/questions/10196929/retrieving-images-from-database-and-displaying-all-on-a-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!