Jump to content

Indexing images in database table


PHPBear

Recommended Posts

I don't know if this is the right forum for this question, but here goes...

 

I have a lot of articles with images stored in a number of database tables. I'd love to have some way of keeping track of all my images, but it's hard to keep up with all the updates. If I list all my images in a spreadsheet, for example, then I'd have to change the path to 100 images if those images get moved into a new folder.

 

But I wondered if there might be some way to display a list of all the images in a database table using regex or something similar.

 

Image a table named geozoo_articles, for example, with articles stored in a field named 'Article'. Is there some way I could display every article, but with everything deleted except images?

 

Many of my images are displayed in floated or centered divs, like this:

 

 

<div class="Img pull-right Wx400">
  <img src="map.jpg" alt="A map">
  <div class="Caption">This is a map</div>
</div>

 

So I actually have two goals. The first is to simply create a list of images (with matching pages or URL's):

 

map.jpg

 

The other goal is to create a list of all divs that contain images, with all the related information. In other words, an article that features ten paragraphs plus the image cited above would display this:

 

 

<div class="Img pull-right Wx400">
  <img src="map.jpg" alt="A map">
  <div class="Caption">This is a map</div>
</div>

 

I imagine that would be pretty tricky, but would it be doable if I gave every div that includes an image the tag Img?

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/295062-indexing-images-in-database-table/
Share on other sites

  • 4 months later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.