Store an image link in MySQL using Navicat Premium

526 views Asked by At

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

There are 1 answers

1
vaso123 On BEST ANSWER

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.