如何从数据库中显示图像? [英] how to display image from database?

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

问题描述

我正在为家电中心做一个网站..

i需要显示该公司提供的所有产品,但我的问题是我无法显示我的数据库中的所有图像..第一个数据库中的条目是唯一显示的..

i我使用mysql作为数据库


这里的代码..告诉我什么''我的错误,请。亲切地编辑它..


** imgdata =它是我存储图像的地方.. longblob是数据类型

i am doing a site for appliance center..
i need to display all the products that the company offers, but my problem is that i cant display ALL the images in my database.. the first entry on the database is the only one that displays..
i am using mysql as database

here''s the code.. tell me what''s my error and pls. kindly edit it..

**imgdata = it is where i store the image.. longblob is the data type

展开 | 选择 | Wrap | 行号

推荐答案

hi

更改mysql_fetch_array()
hi
change in the mysql_fetch_array()
展开 | 选择 | < span class =codeLinkonclick =WordWrap(this);> Wrap | 行号




这里的问题是你只能使用内容处理来发送一个文件。 />
由于每个blob存储不同的图像,您将需要另一个页面循环数据库,并显示内容处置页面。


实现此目的的步骤... 。

首先将您的选择查询更改为基于表中的ID,并从查询字符串中获取该ID(
Hi,
the problem here is that you are only able to use the content disposition to send out one file.
As each blob stores a different image you will need another page thats loops through the DB, and displays the content disposition page.

Steps to achieve this....
Firstly change your select query to be based on the ID in the table, and get that ID from the query string (


_GET [''ID' '])或类似的东西。


其次制作另一页并在该页面中循环显示表格中的结果,打印出带有内容处理页面和查询中的ID的图像字符串。


如果你愿意,我可以详细介绍。让我知道
_GET[''ID'']) or something like that.

Secondly make another page and in that page loop through the results from the table printing out an image with the content disposition page and an ID in the query string.

I can go in to more detail if you like. let me know


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

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