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
Share on other sites

  • 4 months later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.