dpg98445 2014-11-19 13:45
浏览 387
已采纳

使用Navicat Premium在MySQL中存储图像链接

I'm designing a dynamic website with Joomla and my PHP part is handled by Dreamweaver.

I'm using Navicat Premium to build my database.

One raw (varchar) in my database contains images. I found that having images as BLOBS in database is not a good idea.

But, Linking the image as /img/image.php in the cell is not working.

Actually I'm using Dreamweaver to fetch database table to the result page.

Please help me in-

  1. Inserting the image link to the cell via Navicat Premium.
  2. Any modifications I should do in Dreamweaver after inserting the proper link in the cell.

Thanks.!

Screenshot of result page

Screenshot of result page

  • 写回答

1条回答 默认 最新

  • dtrhd2850 2014-11-19 14:37
    关注

    The problem is, you are mixing the Address and image. You have several option. Let's create an image field in your database, and when you loop through your records, check, is the image field is not empty, and if it's not, then show the image by: <img src="PATH OF IMAGE COMES HERE" alt="" /> in your case <img src="/images/image.png" alt="" />

    With your current design of your table, somehow you need to decide, is it an image, or is it an Address. Because if you just loop through your recordset, then there will be: <img src="London" alt="" />, and London is not a valid image resource.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 搭建pt1000三线制高精度测温电路
  • ¥15 使用Jdk8自带的算法,和Jdk11自带的加密结果会一样吗,不一样的话有什么解决方案,Jdk不能升级的情况
  • ¥15 画两个图 python或R
  • ¥15 在线请求openmv与pixhawk 实现实时目标跟踪的具体通讯方法
  • ¥15 八路抢答器设计出现故障
  • ¥15 opencv 无法读取视频
  • ¥15 用matlab 实现通信仿真
  • ¥15 按键修改电子时钟,C51单片机
  • ¥60 Java中实现如何实现张量类,并用于图像处理(不运用其他科学计算库和图像处理库))
  • ¥20 5037端口被adb自己占了